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/FileExplorer.vue b/frontend/src/components/FileExplorer.vue index b01d385..155da5f 100644 --- a/frontend/src/components/FileExplorer.vue +++ b/frontend/src/components/FileExplorer.vue @@ -36,11 +36,11 @@ @@ -80,7 +80,7 @@ @@ -152,3 +152,4 @@ const download = async () => { text-overflow: ellipsis; } +@/stores/main diff --git a/frontend/src/components/LoginModal.vue b/frontend/src/components/LoginModal.vue index 3d811e8..3735383 100644 --- a/frontend/src/components/LoginModal.vue +++ b/frontend/src/components/LoginModal.vue @@ -39,10 +39,10 @@ import { reactive, ref } from 'vue' import { loginUser } from '@/repositories/User' import type { ISimpleError } from '@/repositories/Client' -import { useDocumentStore } from '@/stores/documents' +import { useMainStore } from '@/stores/main' const confirmLoading = ref(false) -const store = useDocumentStore() +const store = useMainStore() const loginForm = reactive({ username: '', @@ -99,3 +99,4 @@ const login = async () => { height: 1em; } +@/stores/main diff --git a/frontend/src/components/UploadButton.vue b/frontend/src/components/UploadButton.vue index d203b19..2bc9efa 100644 --- a/frontend/src/components/UploadButton.vue +++ b/frontend/src/components/UploadButton.vue @@ -1,12 +1,12 @@ +@/stores/main