Fix race condition on resource tab reload

This commit is contained in:
Theodore Li
2026-04-04 18:44:53 -07:00
parent 7971a64e63
commit c8c2b0d28b

View File

@@ -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 {