From c8c2b0d28b10dcc6d3b680bf5767fa4c1989136f Mon Sep 17 00:00:00 2001 From: Theodore Li Date: Sat, 4 Apr 2026 18:44:53 -0700 Subject: [PATCH] Fix race condition on resource tab reload --- apps/sim/app/workspace/[workspaceId]/home/home.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/sim/app/workspace/[workspaceId]/home/home.tsx b/apps/sim/app/workspace/[workspaceId]/home/home.tsx index c0c9f454cc0..64e60027577 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/home.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/home.tsx @@ -188,8 +188,12 @@ export function Home({ chatId }: HomeProps = {}) { [editQueuedMessage] ) + const hasSetResourceRef = useRef(false) useEffect(() => { + if (!activeResourceId && !hasSetResourceRef.current) return + hasSetResourceRef.current = true const url = new URL(window.location.href) + url.hash = '' if (activeResourceId) { url.searchParams.set('resource', activeResourceId) } else {