optimize open database calls
This commit is contained in:
@@ -52,7 +52,7 @@ import { appApi } from 'src/boot/axios';
|
||||
import { i18n } from 'src/boot/lang';
|
||||
import SiteTitle from 'src/vueLib/general/SiteTitle.vue';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { databaseName, workspace } from 'src/vueLib/models/settings';
|
||||
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
const stats = ref();
|
||||
@@ -71,8 +71,11 @@ const amounts = ref<{
|
||||
const { NotifyResponse } = useNotify();
|
||||
|
||||
onMounted(async () => {
|
||||
let path = databaseName.value;
|
||||
if (workspace.value !== '') path = workspace.value + '/' + path;
|
||||
const user = useUserStore().user;
|
||||
const workspaceUuid = useUserStore().getWorkspaceUuid;
|
||||
let path = user?.settings?.databaseName;
|
||||
if (workspaceUuid !== undefined) path = workspaceUuid + '/' + path;
|
||||
|
||||
stats.value = await appApi
|
||||
.post('/stats', { database: path })
|
||||
.then((resp) => {
|
||||
|
||||
Reference in New Issue
Block a user