From 8fc6284317e119d6af31a9e38a56958dc37c0c9c Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Tue, 18 Jun 2024 23:33:49 +0100 Subject: [PATCH] chore: on deleting an uploaded doc, default doc gets set as selected source doc --- frontend/src/Navigation.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 76e09608..76a0daaf 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -137,6 +137,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ) as HTMLElement; const parentElement = imageElement.parentNode as HTMLElement; parentElement.parentNode?.removeChild(parentElement); + + dispatch(setSelectedDocs(docs?.find((doc) => doc.name == 'default'))); }) .catch((error) => console.error(error)); };