From 0444a61ed9438b3afc1e3b69a38e6e3126224d5e Mon Sep 17 00:00:00 2001 From: Nikita Konev Date: Thu, 16 Nov 2023 02:24:41 +0400 Subject: [PATCH] Fix for clicking on the source of the answered message during search --- frontend/src/MessageList.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/MessageList.vue b/frontend/src/MessageList.vue index f6515a24b..297c16818 100644 --- a/frontend/src/MessageList.vue +++ b/frontend/src/MessageList.vue @@ -314,7 +314,13 @@ await this.onSearchStringChanged() }, async onSearchStringChanged() { - await this.reloadItems(); + if (!hasLength(this.highlightMessageId)) { // if is required for case + // user searched for some text ("telegram", or "www") + // then in one of found messages user clicks on the original of the answered (which jumps to th original) + // without this fix because of two events (a. search string changed (see in the search mixin), b. route changed (see here in watch)) + // the message list is loaded 2 times and as a result the second load resets both scrolling and highlighting) + await this.reloadItems(); + } }, setHash() { this.hasInitialHash = hasLength(this.highlightMessageId);