diff --git a/.changeset/fix-dms-nav-not-naving.dm b/.changeset/fix-dms-nav-not-naving.dm new file mode 100644 index 000000000..53751aa01 --- /dev/null +++ b/.changeset/fix-dms-nav-not-naving.dm @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix dms navigation not navigating to dms when local storage is messed up. \ No newline at end of file diff --git a/src/app/pages/client/sidebar/DirectTab.tsx b/src/app/pages/client/sidebar/DirectTab.tsx index 17c88a042..ffdf9c5ac 100644 --- a/src/app/pages/client/sidebar/DirectTab.tsx +++ b/src/app/pages/client/sidebar/DirectTab.tsx @@ -82,7 +82,9 @@ 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; }