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

feat: use one stream for all messages #1003

Merged
merged 4 commits into from
Oct 29, 2022

Conversation

neekolas
Copy link
Contributor

What does this PR do?

  • Use a single stream for all conversations to update previews
  • Also refactors streams to not require state. Can just declare local variables inside the useEffect hook

Fixes # (issue)

CleanShot.2022-10-28.at.12.13.43.mp4

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Send message to an existing conversation. Ensure preview is updated
  • Create a new conversation and send the first message. Preview should appear in the left panel.

@neekolas neekolas requested a review from bigint as a code owner October 28, 2022 19:16
@vercel
Copy link

vercel bot commented Oct 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lenster ✅ Ready (Inspect) Visit Preview Oct 28, 2022 at 7:37PM (UTC)

@vercel vercel bot temporarily deployed to Preview October 28, 2022 19:37 Inactive
@@ -31,9 +31,7 @@ const useMessagePreviews = () => {
const setPreviewMessage = useMessageStore((state) => state.setPreviewMessage);
const reset = useMessageStore((state) => state.reset);
const [profileIds, setProfileIds] = useState<Set<string>>(new Set<string>());
const [conversationStream, setConversationStream] = useState<Stream<Conversation>>();
// TODO: Remove this and replace with streamAllMessages. Just need to make some changes in xmtp-js first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@bigint bigint changed the title Clear localstorage on all logout methods feat: use one stream for all messages Oct 29, 2022
@bigint bigint merged commit df8a50e into main Oct 29, 2022
@bigint bigint deleted the clear-localstorage-on-all-logout-methods branch October 29, 2022 02:50
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.

3 participants