Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AiChat useEffect hook #42

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

divyeshradadiya
Copy link
Contributor

  1. Renamed the inner function to updateAiChatProps for clarity and readability.
    2)Moved the call to handleNewPropsReceived inside the updateAiChatProps function to encapsulate the logic for updating the AI chat props.
  2. Ensured that the update of AI chat props is only performed if isUseEffectCancelled is false, new props are available, and the AI chat instance (aiChat.current) exists.
    4)Updated the useEffect dependency array to include props and currentProps for proper dependency tracking.

  1) Renamed the inner function to updateAiChatProps for clarity and readability.
   2)Moved the call to handleNewPropsReceived inside the updateAiChatProps function to encapsulate the logic for updating the AI chat props.
   3) Ensured that the update of AI chat props is only performed if isUseEffectCancelled is false, new props are available, and the AI chat instance (aiChat.current) exists.
    4)Updated the useEffect dependency array to include props and currentProps for proper dependency tracking.
@salmenus
Copy link
Member

@divyeshradadiya Thank you for your pull request. Merging.

FYI:

I'm in the process of re-factoring / re-writing the entire React part of the project.
New code here: #43 ( not merged yet ).

@salmenus salmenus merged commit 9f707fa into nlkitai:latest Mar 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants