Skip to content

Commit

Permalink
[FIX] Delete messages while searching bug (#16568)
Browse files Browse the repository at this point in the history
  • Loading branch information
karimelghazouly authored Feb 21, 2020
1 parent d1d124f commit 7227b2e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/ui-utils/client/lib/RoomHistoryManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ export const RoomHistoryManager = new class {
}
const room = this.getRoom(message.rid);
room.isLoading.set(true);
ChatMessage.remove({ rid: message.rid });

let typeName = undefined;

const subscription = ChatSubscription.findOne({ rid: message.rid });
Expand All @@ -272,6 +270,7 @@ export const RoomHistoryManager = new class {
if (!result || !result.messages) {
return;
}
ChatMessage.remove({ rid: message.rid });
for (const msg of Array.from(result.messages)) {
if (msg.t !== 'command') {
upsertMessage({ msg, subscription });
Expand Down

0 comments on commit 7227b2e

Please sign in to comment.