perf: refs #7826 code onError
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2025-01-26 23:49:40 +01:00
parent 24c62b4533
commit 0aa9975535
4 changed files with 3 additions and 14 deletions

View File

@ -55,6 +55,7 @@ export default configure(function (/* ctx */) {
browser: ['es2022', 'edge88', 'firefox78', 'chrome87', 'safari13.1'], browser: ['es2022', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
node: 'node18', node: 'node18',
}, },
vueRouterMode: 'hash', // available values: 'hash', 'history' vueRouterMode: 'hash', // available values: 'hash', 'history'
// vueRouterBase, // vueRouterBase,
// vueDevtools, // vueDevtools,
@ -67,12 +68,6 @@ export default configure(function (/* ctx */) {
// env: {}, // env: {},
rawDefine: { rawDefine: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.BUILD_VERSION': JSON.stringify(
new Date()
.toISOString()
.replace(/[-:T.]/g, '')
.slice(0, 14),
), // Versión con marca de tiempo
}, },
// ignorePublicFolder: true, // ignorePublicFolder: true,
// minify: false, // minify: false,

View File

@ -34,11 +34,9 @@ quasar.iconMapFn = (iconName) => {
content: iconName, content: iconName,
}; };
}; };
const env = process.env.BUILD_VERSION;
</script> </script>
<template> <template>
<meta name="app-version" :content="env" />
<RouterView /> <RouterView />
</template> </template>

View File

@ -65,7 +65,6 @@ const refresh = () => window.location.reload();
<div id="searchbar-after"></div> <div id="searchbar-after"></div>
<QSpace /> <QSpace />
<div class="q-pl-sm q-gutter-sm row items-center no-wrap"> <div class="q-pl-sm q-gutter-sm row items-center no-wrap">
{{ state }}
<div id="actions-prepend"></div> <div id="actions-prepend"></div>
<QIcon <QIcon
name="refresh" name="refresh"

View File

@ -102,15 +102,12 @@ export default defineRouter(function (/* { store, ssrContext } */) {
document.title = title; document.title = title;
}); });
Router.onError((error) => { Router.onError(({ message }) => {
const errorMessages = [ const errorMessages = [
'Failed to fetch dynamically imported module', 'Failed to fetch dynamically imported module',
'Importing a module script failed', 'Importing a module script failed',
]; ];
state.set( state.set('error', errorMessages.some(message.includes));
'error',
errorMessages.some((msg) => error.message.includes(msg)),
);
}); });
return Router; return Router;
}); });