feat(legal): add legal notice error handling

The legal notice view now shows an error box if the legal notice could
not be loaded.
This commit is contained in:
2026-08-05 18:57:01 +02:00
parent 83c0524329
commit ba56cfe494
5 changed files with 26 additions and 5 deletions
+10 -2
View File
@@ -21,9 +21,14 @@ import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const legalNoticeError = ref(null);
const legalNoticeHtml = ref(null);
onMounted(async () => {
legalNoticeHtml.value = await getLegalNotice();
try {
legalNoticeHtml.value = await getLegalNotice();
} catch {
legalNoticeError.value = 'legal.notice.loadError';
}
});
</script>
@@ -35,7 +40,10 @@ onMounted(async () => {
</h1>
</header>
<main>
<div class="legal-notice" v-html="legalNoticeHtml"></div>
<div class="error" v-if="legalNoticeError">
{{ t(legalNoticeError) }}
</div>
<div class="legal-notice" v-html="legalNoticeHtml" v-else></div>
</main>
</div>
</template>
+2 -1
View File
@@ -64,7 +64,8 @@
},
"legal": {
"notice": {
"title": "Impressum"
"title": "Impressum",
"loadError": "Das Impressum konnte nicht geladen werden."
}
}
}
+2 -1
View File
@@ -64,7 +64,8 @@
},
"legal": {
"notice": {
"title": "Legal Notice"
"title": "Legal Notice",
"loadError": "The legal notice could not be loaded."
}
}
}
+9 -1
View File
@@ -92,4 +92,12 @@ input {
/* Temporary until a custom tap highlight is implemented. */
* {
-webkit-tap-highlight-color: transparent;
}
}
.error {
background-color: var(--color-negative-bg);
border: 1px solid var(--color-negative-border);
padding: 1em 2em;
border-radius: 1.2em;
color: var(--white);
}
+3
View File
@@ -84,6 +84,9 @@ body {
--light-hover: var(--light-d-2);
--invert: invert(0);
--color-negative-bg: oklch(59% 0.22706 29.244);
--color-negative-border: oklch(51% 0.22706 29.244);
}
@media (prefers-color-scheme: dark) {