mirror of
https://github.com/directus/directus.git
synced 2026-01-26 05:38:09 -05:00
Show error on hydration problem
This commit is contained in:
@@ -6,7 +6,15 @@
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<router-view v-if="!hydrating && appAccess" />
|
||||
<v-info v-if="error" type="danger" :title="$t('unexpected_error')" icon="error" center>
|
||||
{{ $t('unexpected_error_copy') }}
|
||||
|
||||
<template #append>
|
||||
<v-error :error="error" />
|
||||
</template>
|
||||
</v-info>
|
||||
|
||||
<router-view v-else-if="!hydrating && appAccess" />
|
||||
|
||||
<v-info v-else-if="appAccess === false" center :title="$t('no_app_access')" type="danger" icon="block">
|
||||
{{ $t('no_app_access_copy') }}
|
||||
@@ -82,7 +90,9 @@ export default defineComponent({
|
||||
return userStore.state.currentUser?.role?.app_access;
|
||||
});
|
||||
|
||||
return { hydrating, brandStyle, appAccess };
|
||||
const error = computed(() => appStore.state.error);
|
||||
|
||||
return { hydrating, brandStyle, appAccess, error };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -11,8 +11,10 @@ export const useSettingsStore = createStore({
|
||||
}),
|
||||
actions: {
|
||||
async hydrate() {
|
||||
const response = await api.get(`/settings`, { params: { fields: ['*.*'] } });
|
||||
this.state.settings = response.data.data;
|
||||
try {
|
||||
const response = await api.get(`/settings`, { params: { fields: ['*.*'] } });
|
||||
this.state.settings = response.data.data;
|
||||
} catch {}
|
||||
},
|
||||
|
||||
async dehydrate() {
|
||||
|
||||
Reference in New Issue
Block a user