mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Fix race condition on resource tab reload
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user