chore: on deleting an uploaded doc, default doc gets set as selected source doc

This commit is contained in:
utin-francis-peter 2024-06-18 23:33:49 +01:00
parent e6b3984f78
commit 8fc6284317

View File

@ -137,6 +137,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
) as HTMLElement; ) as HTMLElement;
const parentElement = imageElement.parentNode as HTMLElement; const parentElement = imageElement.parentNode as HTMLElement;
parentElement.parentNode?.removeChild(parentElement); parentElement.parentNode?.removeChild(parentElement);
dispatch(setSelectedDocs(docs?.find((doc) => doc.name == 'default')));
}) })
.catch((error) => console.error(error)); .catch((error) => console.error(error));
}; };