From 33a119f29b40887f353c4d39cefa11b52f47fc0a Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 16 Apr 2025 13:08:50 -0600 Subject: [PATCH] update --- .../features/versionHistory/useListVersionHistories.tsx | 2 ++ web/src/context/BusterAppLayout/AppLayoutProvider.tsx | 1 + .../VersionHistoryHeaderButtons.tsx | 2 +- .../FileContainerHeaderVersionHistory/useCloseVersionHistory.ts | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/components/features/versionHistory/useListVersionHistories.tsx b/web/src/components/features/versionHistory/useListVersionHistories.tsx index dc5f98614..51b9db795 100644 --- a/web/src/components/features/versionHistory/useListVersionHistories.tsx +++ b/web/src/components/features/versionHistory/useListVersionHistories.tsx @@ -77,6 +77,7 @@ export const useListVersionHistories = ({ metricId: assetId }) ); + onCloseVersionHistory(); } } if (type === 'dashboard') { @@ -88,6 +89,7 @@ export const useListVersionHistories = ({ dashboardId: assetId }) ); + onCloseVersionHistory(); } } diff --git a/web/src/context/BusterAppLayout/AppLayoutProvider.tsx b/web/src/context/BusterAppLayout/AppLayoutProvider.tsx index 29e5af631..aa4c6725a 100644 --- a/web/src/context/BusterAppLayout/AppLayoutProvider.tsx +++ b/web/src/context/BusterAppLayout/AppLayoutProvider.tsx @@ -60,6 +60,7 @@ export const useAppLayout = () => { // Start the navigation push(targetPath); + console.log('pushed', targetPath); // Start checking for path changes checkPathChange(); diff --git a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/VersionHistoryHeaderButtons.tsx b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/VersionHistoryHeaderButtons.tsx index cd025a4cc..22307550a 100644 --- a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/VersionHistoryHeaderButtons.tsx +++ b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/VersionHistoryHeaderButtons.tsx @@ -23,7 +23,7 @@ export const VersionHistoryHeaderButtons: React.FC<{}> = ({}) => { const onClickRestoreVersionPreflight = useMemoizedFn(async () => { if (selectedQueryVersion) { - await onClickRestoreVersion(selectedQueryVersion, true); + await onClickRestoreVersion(selectedQueryVersion); } }); diff --git a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/useCloseVersionHistory.ts b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/useCloseVersionHistory.ts index 4ab7e8db7..c88083669 100644 --- a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/useCloseVersionHistory.ts +++ b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/FileContainerHeaderVersionHistory/useCloseVersionHistory.ts @@ -7,6 +7,7 @@ import { useMemo } from 'react'; export const useCloseVersionHistory = () => { const onChangePage = useAppLayoutContextSelector((x) => x.onChangePage); + const closeSecondaryView = useChatLayoutContextSelector((x) => x.closeSecondaryView); const chatId = useChatLayoutContextSelector((x) => x.chatId); const metricId = useChatLayoutContextSelector((x) => x.metricId); const dashboardId = useChatLayoutContextSelector((x) => x.dashboardId); @@ -36,6 +37,7 @@ export const useCloseVersionHistory = () => { const onCloseVersionHistory = useMemoizedFn(() => { onChangePage(href); + closeSecondaryView(); }); return { href, onCloseVersionHistory };