diff --git a/package.json b/package.json index 7201c1489..8f1ab6628 100644 --- a/package.json +++ b/package.json @@ -158,7 +158,6 @@ "@tiptap/starter-kit": "^2.10.4", "@vueuse/core": "catalog:", "@vueuse/integrations": "catalog:", - "@vueuse/router": "^14.0.0", "@xterm/addon-fit": "^0.10.0", "@xterm/addon-serialize": "^0.13.0", "@xterm/xterm": "^5.5.0", diff --git a/src/stores/subgraphNavigationStore.ts b/src/stores/subgraphNavigationStore.ts index 75df0ec24..3a03e17f2 100644 --- a/src/stores/subgraphNavigationStore.ts +++ b/src/stores/subgraphNavigationStore.ts @@ -1,7 +1,6 @@ import QuickLRU from '@alloc/quick-lru' import { defineStore } from 'pinia' import { computed, ref, shallowRef, watch } from 'vue' -import { useRouteHash } from '@vueuse/router' import type { DragAndScaleState } from '@/lib/litegraph/src/DragAndScale' import type { Subgraph } from '@/lib/litegraph/src/litegraph' @@ -158,7 +157,12 @@ export const useSubgraphNavigationStore = defineStore( onNavigated(newValue, oldValue) } ) - const routeHash = useRouteHash() + const routeHash = ref(window.location.hash) + const originalOnHashChange = window.onhashchange + window.onhashchange = (...args) => { + routeHash.value = window.location.hash + return originalOnHashChange?.apply(window, args) + } let blockHashUpdate = false let initialLoad = true diff --git a/src/stores/subgraphNavigationStore.viewport.test.ts b/src/stores/subgraphNavigationStore.viewport.test.ts index 672af4490..6dbf85a6b 100644 --- a/src/stores/subgraphNavigationStore.viewport.test.ts +++ b/src/stores/subgraphNavigationStore.viewport.test.ts @@ -1,6 +1,6 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it, vi } from 'vitest' -import { nextTick, ref } from 'vue' +import { nextTick } from 'vue' import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore' import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore' @@ -41,10 +41,6 @@ vi.mock('@/renderer/core/canvas/canvasStore', () => ({ }) })) -vi.mock('@vueuse/router', () => ({ - useRouteHash: () => ref('') -})) - // Get reference to mock canvas const mockCanvas = app.canvas as any