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

Fix: Include pinned messages from threads in the main chat interface #854

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

smritidoneria
Copy link
Contributor

@smritidoneria smritidoneria commented Jan 9, 2025

Brief Title

This pull request addresses the issue where pinned messages in threads do not appear in the main chat interface. The solution involves fetching pinned messages from both the main chat and threads and combining them to ensure they are all displayed in the main chat interface.

Fixes #853

Video/Screenshots

Screen.Recording.2025-01-09.at.9.46.00.PM.mov

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.

const sortedMessages = messages.sort(
(a, b) => new Date(b.ts) - new Date(a.ts)
);
console.log(sortedMessages);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove log

@smritidoneria
Copy link
Contributor Author

Done

return;
}
const { messages } = await RCInstance.getPinnedMessages();
const sortedMessages = messages.sort(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need sorting, if messages are lot, this will take time right ?

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.

Pinned messages in threads do not appear in the main chat interface
2 participants