mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-19 08:59:11 +00:00
Only handle idle history events (#1872)
only handle idle history events
This commit is contained in:
parent
1db2a4eccc
commit
cd32f530d6
|
@ -95,6 +95,9 @@ function AppInner() {
|
||||||
const router = createMemoryRouterWithHistory({ routes, history });
|
const router = createMemoryRouterWithHistory({ routes, history });
|
||||||
|
|
||||||
const dispose = router.subscribe((event) => {
|
const dispose = router.subscribe((event) => {
|
||||||
|
// we don't care about non-idle events as those are artifacts of form mutations + suspense
|
||||||
|
if (event.navigation.state !== 'idle') return;
|
||||||
|
|
||||||
setTabs((routers) => {
|
setTabs((routers) => {
|
||||||
const index = routers.findIndex((r) => r.router === router);
|
const index = routers.findIndex((r) => r.router === router);
|
||||||
if (index === -1) return routers;
|
if (index === -1) return routers;
|
||||||
|
|
Loading…
Reference in a new issue