From 8204c3481ad1e5eb3f59cabdb5c3c52936094b48 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sun, 27 Nov 2022 14:00:10 +0100 Subject: [PATCH] search: fix order of result merging During a search, we get the results from oldest --> newest. When we hit the more button, we get the results of the second batch in the same order. However, logically to the first batch everything is older, so we need to prepend it to the result array, not append. msg DB logical ID A 3 5 B 2 4 C 1 3 D 3 2 E 2 1 F 1 0 --- client/js/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/store.ts b/client/js/store.ts index 171a8c56..0ce7a1f5 100644 --- a/client/js/store.ts +++ b/client/js/store.ts @@ -354,7 +354,7 @@ const mutations: Mutations = { return; } - const results = [...state.messageSearchResults.results, ...value.results]; + const results = [...value.results, ...state.messageSearchResults.results]; state.messageSearchResults = { results,