Skip to content

Commit

Permalink
Merge branch 'develop' into feat/password-verification
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jun 16, 2023
2 parents cedd1e6 + 0f22271 commit 3077f9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-ravens-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fixed an issue where the room history is lost when jumping to an older message that is not already loaded
7 changes: 3 additions & 4 deletions apps/meteor/app/ui-utils/client/lib/RoomHistoryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,14 @@ class RoomHistoryManagerClass extends Emitter {
return;
}

const surroundingMessage = ChatMessage.findOne({ _id: message._id, _hidden: { $ne: true } });
const messageAlreadyLoaded = Boolean(ChatMessage.findOne({ _id: message._id, _hidden: { $ne: true } }));

if (surroundingMessage) {
if (messageAlreadyLoaded) {
return;
}

const room = this.getRoom(message.rid);
room.isLoading.set(true);
room.hasMore.set(false);
void this.clear(message.rid);

const subscription = ChatSubscription.findOne({ rid: message.rid });

Expand Down

0 comments on commit 3077f9b

Please sign in to comment.