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

Retain session through view changes #1580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matthewdiamant
Copy link
Collaborator

Fixes: #1532

Currently, chat messages are stored in the Chat View. So, if you navigate away from the Chat View (such as to Settings), the chat messages are lost.

This PR:

  1. Moves chat message storage to the root level of the App. That way, navigating to any screen means that the chat is always retained,
  2. Consolidates chat logic inside of a new hook useChat(). There was a few different files in which messages we being loaded/reloaded, and now it all happens here. This also allows for some refactoring and simplifying. chat is now where both the messages and id (aka session id) now live. It might be a good idea to combine this with the useMessageStream() hook, given that they share a bit of responsibility and are mildly stepping on each other's toes.

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.

Opening settings in GUI and then going "back" drops the session
1 participant