Giter Club home page Giter Club logo

Comments (3)

veserai avatar veserai commented on September 12, 2024 2

I was able to fix it on my own. The problem was: /app/compontents/index.tsx: The "oncompleted" function fails while fetching the conversations.id . Therefore the bot never reaches the state, where the "setResponsingFalse()" is set.
I rewrote the async onCompleted like this:

async onCompleted(hasError?: boolean) {
        // Immediately set the chatbot as not responding, regardless of potential errors in fetching conversations
        setResponsingFalse();
        
        if (hasError) {
          return; // Early return if there was an error in the chat message operation
        }

        try {
          // Attempt to fetch all conversations and generate a new name for the conversation
          const { data: allConversations }: any = await fetchConversations();
          if (allConversations && allConversations.length > 0) {
            const newItem: any = await generationConversationName(allConversations[0].id);
            
            // Proceed with setting new conversation information and resetting state as needed
            const newAllConversations = produce(allConversations, (draft: any) => {
              draft[0].name = newItem.name;
            });
            setConversationList(newAllConversations as any);
            
            // Additional logic to reset inputs and conversation IDs as needed
            if (getConversationIdChangeBecauseOfNew()) {
              setConversationIdChangeBecauseOfNew(false);
              resetNewConversationInputs();
              setChatNotStarted();
              setCurrConversationId(allConversations[0].id, APP_ID, true);
            }
          } else {
            // Handle the case where no conversations are returned
            console.error("No conversations were fetched.");
          }
        } catch (error) {
          console.error("An error occurred while fetching conversations or generating a new conversation name:", error);
          // Here, handle the error as needed, possibly setting additional error states or displaying a message to the user
        }
      },

from webapp-conversation.

taowang1993 avatar taowang1993 commented on September 12, 2024

After you embed the chatbot in another website, can other people still access your web app UI?

from webapp-conversation.

veserai avatar veserai commented on September 12, 2024

After you embed the chatbot in another website, can other people still access your web app UI?

Before I fixed it -> No

After my fix -> Yes

Please make sure to have SSL activated (For example by using a reverse Proxy), otherwise many brothers will block the iFrame

from webapp-conversation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.