diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 104dd5a..88b2bf6 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -17,7 +17,7 @@ import type { ComputedRef } from 'vue' import type HeaderMain from '@/components/HeaderMain.vue' import { onMounted, onUnmounted, ref, watchEffect } from 'vue' import { loadSession, watchConnect, watchDisconnect } from '@/repositories/WS' -import { useDocumentStore } from '@/stores/documents' +import { useMainStore } from '@/stores/main' import { computed } from 'vue' import Router from '@/router/index' @@ -27,7 +27,7 @@ interface Path { pathList: string[] query: string } -const documentStore = useDocumentStore() +const store = useMainStore() const path: ComputedRef = computed(() => { const p = decodeURIComponent(Router.currentRoute.value.path).split('//') const pathList = p[0].split('/').filter(value => value !== '') @@ -39,7 +39,7 @@ const path: ComputedRef = computed(() => { } }) watchEffect(() => { - document.title = path.value.path.replace(/\/$/, '').split('/').pop() || documentStore.server.name || 'Cista Storage' + document.title = path.value.path.replace(/\/$/, '').split('/').pop() || store.server.name || 'Cista Storage' }) onMounted(loadSession) onMounted(watchConnect) @@ -48,7 +48,7 @@ const headerMain = ref(null) let vert = 0 let timer: any = null const globalShortcutHandler = (event: KeyboardEvent) => { - const fileExplorer = documentStore.fileExplorer as any + const fileExplorer = store.fileExplorer as any if (!fileExplorer) return const c = fileExplorer.isCursor() const keyup = event.type === 'keyup' @@ -124,3 +124,4 @@ onUnmounted(() => { }) export type { Path } +@/stores/main diff --git a/frontend/src/components/BreadCrumb.vue b/frontend/src/components/BreadCrumb.vue index ce98fda..e0cbdc9 100644 --- a/frontend/src/components/BreadCrumb.vue +++ b/frontend/src/components/BreadCrumb.vue @@ -4,7 +4,7 @@ aria-label="Breadcrumb" @keyup.left.stop="move(-1)" @keyup.right.stop="move(1)" - @focus="move(0)" + @keyup.enter="move(0)" > { if (!link) throw Error(`No link at index ${index} (path: ${props.path})`) const url = `/${longest.value.slice(0, index).join('/')}/` const here = `/${longest.value.join('/')}/` + const current = decodeURIComponent(location.hash.slice(1).split('//')[0]) + const u = url.replaceAll('?', '%3F').replaceAll('#', '%23') + if (here.startsWith(current)) router.replace(u) + else router.push(u) link.focus() - if (here.startsWith(location.hash.slice(1))) router.replace(url) - else router.push(url) } const move = (dir: number) => { diff --git a/frontend/src/components/FileExplorer.vue b/frontend/src/components/FileExplorer.vue index 3a0cdb0..f873093 100644 --- a/frontend/src/components/FileExplorer.vue +++ b/frontend/src/components/FileExplorer.vue @@ -17,7 +17,7 @@ - + @@ -36,11 +36,11 @@ @@ -50,7 +50,7 @@ - + @@ -79,28 +79,24 @@ diff --git a/frontend/src/components/FileRenameInput.vue b/frontend/src/components/FileRenameInput.vue index aaa6977..6f1aff2 100644 --- a/frontend/src/components/FileRenameInput.vue +++ b/frontend/src/components/FileRenameInput.vue @@ -12,7 +12,7 @@ diff --git a/frontend/src/components/HeaderMain.vue b/frontend/src/components/HeaderMain.vue index f8206c1..eefc739 100644 --- a/frontend/src/components/HeaderMain.vue +++ b/frontend/src/components/HeaderMain.vue @@ -1,15 +1,15 @@