diff --git a/.changeset/fix-dms-nav-not-naving.md b/.changeset/fix-dms-nav-not-naving.md new file mode 100644 index 000000000..2e214e4a8 --- /dev/null +++ b/.changeset/fix-dms-nav-not-naving.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix dms navigation not navigating to dms when local storage is messed up. diff --git a/src/app/pages/client/sidebar/DirectTab.tsx b/src/app/pages/client/sidebar/DirectTab.tsx index 17c88a042..72c2b7d5b 100644 --- a/src/app/pages/client/sidebar/DirectTab.tsx +++ b/src/app/pages/client/sidebar/DirectTab.tsx @@ -82,7 +82,10 @@ export function DirectTab() { const handleDirectClick = () => { const activePath = navToActivePath.get('direct'); - if (activePath && screenSize !== ScreenSize.Mobile) { + const activePathname = activePath?.pathname; + const isValidDirectPath = + typeof activePathname === 'string' && activePathname.startsWith('/direct/'); + if (activePath && isValidDirectPath && screenSize !== ScreenSize.Mobile) { navigate(joinPathComponent(activePath)); return; }