Refactor to use localized state management for conversation ID#124
Open
Asin-Junior-Honore wants to merge 2 commits into
Open
Refactor to use localized state management for conversation ID#124Asin-Junior-Honore wants to merge 2 commits into
Asin-Junior-Honore wants to merge 2 commits into
Conversation
Asin-Junior-Honore
requested review from
Arindam-at-Pieces,
mason-at-pieces and
shivaypiece
as code owners
June 18, 2024 09:54
Author
|
hey |
Arindam200
reviewed
Jul 1, 2024
Arindam200
left a comment
Contributor
There was a problem hiding this comment.
Can You please remove the extra spaces and unwanted changes?
Rest looks Good to me.
Comment on lines
+35
to
62
| new Pieces.ConversationsApi() | ||
| .conversationsCreateSpecificConversationRaw({ | ||
| transferables: true, | ||
| seededConversation, | ||
| }) | ||
| .then((_c) => { | ||
| console.log("Conversation created! : Here is the response:"); | ||
| console.log(_c); | ||
|
|
||
| // check and ensure the response back is clean. | ||
| if (_c.raw.ok == true && _c.raw.status == 200) { | ||
| console.log("CLEAN RESPONSE BACK."); | ||
| _c.value().then((_conversation) => { | ||
| console.log("Returning new conversation values."); | ||
| // console.log('ID | ' + _conversation.id); | ||
| // console.log('NAME | ' + _conversation.name); | ||
| // console.log('CREATED | ' + _conversation.created.readable); | ||
| // console.log('ID: ' + _conversation.); | ||
|
|
||
| // Set the conversation variable here for the local file: | ||
| setConversationID(_conversation.id); | ||
| }); | ||
| } | ||
| }); | ||
| } catch (error) { | ||
| console.error('An error occurred while creating a conversation:', error); | ||
| console.error("An error occurred while creating a conversation:", error); | ||
| } | ||
| } |
Author
|
Hey Please review the changes I made based on your request a few hours ago. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the usage of a global variable
GlobalConversationIDinCopilot.tsx. The global variable has been refactored to use localized state management with React'suseStatehook.issue #115
Changes include:
createNewConversationfunction to accept a state setter for conversation ID.CopilotChatcomponent to manage the conversation ID using theuseStatehook.