From 61fc74a1066a695b67165bc4eda335c4c2e1924f Mon Sep 17 00:00:00 2001 From: Aditya Hegde Date: Fri, 13 Dec 2024 13:26:18 +0530 Subject: [PATCH] Fix missing home bookmark while siwtching using breadcrumbs --- .../[project]/-/share/[token]/+page.svelte | 1 + .../explore/[dashboard]/+page.svelte | 11 +---- .../StateManagersProvider.svelte | 4 +- .../state-managers/state-managers.ts | 18 -------- .../url-state/DashboardURLStateSync.svelte | 45 ++++++++++--------- 5 files changed, 27 insertions(+), 52 deletions(-) diff --git a/web-admin/src/routes/[organization]/[project]/-/share/[token]/+page.svelte b/web-admin/src/routes/[organization]/[project]/-/share/[token]/+page.svelte index 67ebe8392332..9ce45f6db606 100644 --- a/web-admin/src/routes/[organization]/[project]/-/share/[token]/+page.svelte +++ b/web-admin/src/routes/[organization]/[project]/-/share/[token]/+page.svelte @@ -61,6 +61,7 @@ - import { afterNavigate, onNavigate } from "$app/navigation"; + import { onNavigate } from "$app/navigation"; import { page } from "$app/stores"; import DashboardBuilding from "@rilldata/web-admin/features/dashboards/DashboardBuilding.svelte"; import DashboardErrored from "@rilldata/web-admin/features/dashboards/DashboardErrored.svelte"; @@ -12,7 +12,6 @@ import { useExplore } from "@rilldata/web-common/features/explores/selectors"; import { eventBus } from "@rilldata/web-common/lib/event-bus/event-bus"; import { runtime } from "@rilldata/web-common/runtime-client/runtime-store"; - import type { AfterNavigate } from "@sveltejs/kit"; import type { PageData } from "./$types"; const PollIntervalWhenDashboardFirstReconciling = 1000; @@ -83,12 +82,6 @@ }); } - let previousNavigationType: AfterNavigate["type"]; - afterNavigate(({ from, type }) => { - if (from !== null && !from.url) return; - previousNavigationType = type; - }); - onNavigate(() => { // Temporary: clear the mocked user when navigating away. // In the future, we should be able to handle the mocked user on all project pages. @@ -112,12 +105,12 @@ diff --git a/web-common/src/features/dashboards/state-managers/StateManagersProvider.svelte b/web-common/src/features/dashboards/state-managers/StateManagersProvider.svelte index 36f128234b98..760a05887bfb 100644 --- a/web-common/src/features/dashboards/state-managers/StateManagersProvider.svelte +++ b/web-common/src/features/dashboards/state-managers/StateManagersProvider.svelte @@ -1,6 +1,6 @@