From 32b847c26e7c974156dbd19b67b7ea4be76b3a60 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 1 Jul 2022 20:49:41 -0500 Subject: [PATCH] Fixed event propagation trigger navigating twice (#293) --- web/src/lib/components/asset-viewer/asset-viewer.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte index f6382413eb..940915f4e4 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte @@ -63,7 +63,9 @@ dispatch('close'); }; - const navigateAssetForward = () => { + const navigateAssetForward = (e?: Event) => { + e?.stopPropagation(); + const nextAsset = $flattenAssetGroupByDate[selectedIndex + 1]; viewDeviceId = nextAsset.deviceId; viewAssetId = nextAsset.id; @@ -73,7 +75,9 @@ pushState(viewAssetId); }; - const navigateAssetBackward = () => { + const navigateAssetBackward = (e?: Event) => { + e?.stopPropagation(); + const lastAsset = $flattenAssetGroupByDate[selectedIndex - 1]; viewDeviceId = lastAsset.deviceId; viewAssetId = lastAsset.id;