From a98e586b694a730c13cee85bd3c1b5ccae6eb3e8 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Sun, 28 Jan 2024 22:53:00 -0600 Subject: [PATCH] Reset targets accordion when changing pages This fixes a bug where the accordion would stay open when changing pages. --- .../project-[project]/messaging/userTargetsModal.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/routes/console/project-[project]/messaging/userTargetsModal.svelte b/src/routes/console/project-[project]/messaging/userTargetsModal.svelte index 842bbae427..5f5559a928 100644 --- a/src/routes/console/project-[project]/messaging/userTargetsModal.svelte +++ b/src/routes/console/project-[project]/messaging/userTargetsModal.svelte @@ -22,10 +22,7 @@ let search = ''; let offset = 0; let totalResults = 0; - let userResultsById: Record< - string, - Models.User> - > = {}; // use a hash map so we can quickly look up a user by id + let userResultsById: Record>> = {}; // use a hash map so we can quickly look up a user by id let selected: Record = {}; let hasSelection = false; @@ -147,7 +144,7 @@ bind:value={search} /> {#if Object.keys(userResultsById).length > 0} - {#each Object.entries(userResultsById) as [userId, user]} + {#each Object.entries(userResultsById) as [userId, user] (userId)} {@const selectedCount = user.targets.filter( (target) => selected[target.$id] ).length}