#7826 - Fix #1285
|
@ -10,11 +10,7 @@ import { useCau } from 'src/composables/useCau';
|
||||||
export default boot(({ app }) => {
|
export default boot(({ app }) => {
|
||||||
QForm.mixins = [qFormMixin];
|
QForm.mixins = [qFormMixin];
|
||||||
QLayout.mixins = [mainShortcutMixin];
|
QLayout.mixins = [mainShortcutMixin];
|
||||||
const metaVersion = process.env.BUILD_VERSION;
|
|
||||||
const storedVersion = localStorage.getItem('appVersion');
|
|
||||||
if (metaVersion !== storedVersion) {
|
|
||||||
localStorage.setItem('appVersion', metaVersion);
|
|
||||||
}
|
|
||||||
app.directive('shortcut', keyShortcut);
|
app.directive('shortcut', keyShortcut);
|
||||||
app.config.errorHandler = async (error) => {
|
app.config.errorHandler = async (error) => {
|
||||||
let message;
|
let message;
|
||||||
|
|
|
@ -20,6 +20,7 @@ const appName = 'Lilium';
|
||||||
const pinnedModulesRef = ref();
|
const pinnedModulesRef = ref();
|
||||||
|
|
||||||
onMounted(() => stateStore.setMounted());
|
onMounted(() => stateStore.setMounted());
|
||||||
|
const refresh = () => window.location.reload();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QHeader color="white" elevated>
|
<QHeader color="white" elevated>
|
||||||
|
@ -71,7 +72,7 @@ onMounted(() => stateStore.setMounted());
|
||||||
size="md"
|
size="md"
|
||||||
color="red"
|
color="red"
|
||||||
v-if="state.get('error')"
|
v-if="state.get('error')"
|
||||||
@click="() => window.location.reload()"
|
@click="refresh"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
||||||
|
|
|
@ -14,8 +14,6 @@ import { useTokenConfig } from 'src/composables/useTokenConfig';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { isLoggedIn } from 'src/utils/session';
|
import { isLoggedIn } from 'src/utils/session';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { Notify } from 'quasar';
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
|
|
||||||
let session = null;
|
let session = null;
|
||||||
const { t, te } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
@ -101,29 +99,18 @@ export default defineRouter(function (/* { store, ssrContext } */) {
|
||||||
|
|
||||||
title += builtTitle;
|
title += builtTitle;
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
|
||||||
state.set('error', true);
|
|
||||||
}, 1000);
|
|
||||||
document.title = title;
|
document.title = title;
|
||||||
});
|
});
|
||||||
|
|
||||||
Router.onError((error, to) => {
|
Router.onError((error) => {
|
||||||
if (
|
const errorMessages = [
|
||||||
error.message.includes('Failed to fetch dynamically imported module') ||
|
'Failed to fetch dynamically imported module',
|
||||||
error.message.includes('Importing a module script failed')
|
'Importing a module script failed',
|
||||||
) {
|
];
|
||||||
state.set('error', {
|
state.set(
|
||||||
message: t('globals.errorLoadingPage'),
|
'error',
|
||||||
|
|||||||
timeout: 5000,
|
errorMessages.some((msg) => error.message.includes(msg)),
|
||||||
type: 'negative',
|
);
|
||||||
});
|
|
||||||
Notify.create({
|
|
||||||
message: t('globals.noSelectedRows'),
|
|
||||||
type: 'negative',
|
|
||||||
timeout: 5000,
|
|
||||||
progress: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return Router;
|
return Router;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Desde aquí no se podría lanzar un mensaje de error, y el mismo si aceptas te haga reload? @jgallego como lo ves?
A falta de respuesta de javi, te cuento.
Yo tuve el mismo planteamiento al principio pero luego me di cuenta de estos 3 puntos.
Yo de momento pondria lo que habia en salix.