From e31cf33df86c47966fd80a9bbaf8f04c83064124 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 24 May 2024 15:57:08 +0100 Subject: [PATCH] fix: toolbar clickmap reset (#22501) --- frontend/src/toolbar/elements/heatmapLogic.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/toolbar/elements/heatmapLogic.ts b/frontend/src/toolbar/elements/heatmapLogic.ts index f6256a91844be..73cfdbf8e748a 100644 --- a/frontend/src/toolbar/elements/heatmapLogic.ts +++ b/frontend/src/toolbar/elements/heatmapLogic.ts @@ -225,7 +225,11 @@ export const heatmapLogic = kea([ } return { - results: [...(values.elementStats?.results || []), ...paginatedResults.results], + results: [ + // if url is present we are paginating and merge results, otherwise we only use the new results + ...(url ? values.elementStats?.results || [] : []), + ...(paginatedResults.results || []), + ], next: paginatedResults.next, previous: paginatedResults.previous, } as PaginatedResponse