diff --git a/packages/dashboard/src/boot/auth.js b/packages/dashboard/src/boot/auth.js index 18d934a..6b9810c 100644 --- a/packages/dashboard/src/boot/auth.js +++ b/packages/dashboard/src/boot/auth.js @@ -1,15 +1,14 @@ import { boot } from 'quasar/wrappers'; import { useAuthStore } from 'stores/auth-store'; import { useMainStore } from "stores/main-store"; -import store from 'stores/index' -export default boot(async ({router}) => { +export default boot(async ({router, store}) => { // Check if theres any auth token stored, if there is, try to fetch or redirect - const authStore = useAuthStore(store()); + const authStore = useAuthStore(store); const authResp = await authStore.CheckLoginInStorage(router); if (authResp === false) { // No auth token stored, try to fetch without auth or redirect - const mainStore = useMainStore(store()) + const mainStore = useMainStore(store) await mainStore.loadServerConfigs(router, true) } }); diff --git a/packages/dashboard/src/components/utils/DragAndDrop.vue b/packages/dashboard/src/components/utils/DragAndDrop.vue index ba6300d..5e0fc90 100644 --- a/packages/dashboard/src/components/utils/DragAndDrop.vue +++ b/packages/dashboard/src/components/utils/DragAndDrop.vue @@ -60,7 +60,7 @@ export default { this.$refs.foldersUploader.click() }, dragover (event) { - if (this.mainStore.readonly) { + if (this.mainStore.apiReadonly || this.isHover === true) { return } @@ -75,6 +75,10 @@ export default { this.isHover = true }, dragleave (event) { + if (this.isHover === false) { + return + } + if ( event.clientX < this.dragContainer.left || event.clientX > this.dragContainer.right || diff --git a/packages/dashboard/src/stores/main-store.js b/packages/dashboard/src/stores/main-store.js index 0ef5035..ed2ab29 100644 --- a/packages/dashboard/src/stores/main-store.js +++ b/packages/dashboard/src/stores/main-store.js @@ -4,7 +4,7 @@ import { api } from "boot/axios"; export const useMainStore = defineStore('main', { state: () => ({ // Config - readonly: true, + apiReadonly: true, dashboardUrl: '', showHiddenFiles: false, @@ -36,7 +36,7 @@ export const useMainStore = defineStore('main', { } }) - this.readonly = response.data.config.readonly; + this.apiReadonly = response.data.config.readonly; this.dashboardUrl = response.data.config.dashboardUrl; this.showHiddenFiles = response.data.config.showHiddenFiles;