mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
* test: fix cypress tests by deduping vue * chore: add vue dependency to mocks * chore: cleanup
37 lines
838 B
TypeScript
37 lines
838 B
TypeScript
import { client, findById } from './client'
|
|
import { activeFileId } from './params'
|
|
import type { File } from '#types'
|
|
|
|
export const currentModule = ref<File>()
|
|
export const dashboardVisible = ref(true)
|
|
|
|
export function initializeNavigation() {
|
|
const file = activeFileId.value
|
|
if (file && file.length > 0) {
|
|
const current = findById(file)
|
|
if (current) {
|
|
currentModule.value = current
|
|
dashboardVisible.value = false
|
|
}
|
|
else {
|
|
watchOnce(
|
|
() => client.state.getFiles(),
|
|
() => {
|
|
currentModule.value = findById(file)
|
|
dashboardVisible.value = false
|
|
},
|
|
)
|
|
}
|
|
}
|
|
|
|
return dashboardVisible
|
|
}
|
|
|
|
export function showDashboard(show: boolean) {
|
|
dashboardVisible.value = show
|
|
if (show) {
|
|
currentModule.value = undefined
|
|
activeFileId.value = ''
|
|
}
|
|
}
|