Remove vueuse/router

This commit is contained in:
Austin Mroz
2025-12-12 10:53:29 -08:00
parent db9627e02e
commit ab3f3bc2eb
3 changed files with 7 additions and 8 deletions

View File

@@ -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",

View File

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

View File

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