Skip to content

Commit c8c2b0d

Browse files
author
Theodore Li
committed
Fix race condition on resource tab reload
1 parent 7971a64 commit c8c2b0d

File tree

1 file changed

+4
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/home

1 file changed

+4
-0
lines changed

apps/sim/app/workspace/[workspaceId]/home/home.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ export function Home({ chatId }: HomeProps = {}) {
188188
[editQueuedMessage]
189189
)
190190

191+
const hasSetResourceRef = useRef(false)
191192
useEffect(() => {
193+
if (!activeResourceId && !hasSetResourceRef.current) return
194+
hasSetResourceRef.current = true
192195
const url = new URL(window.location.href)
196+
url.hash = ''
193197
if (activeResourceId) {
194198
url.searchParams.set('resource', activeResourceId)
195199
} else {

0 commit comments

Comments
 (0)