fix: Show proper error page when board was not found

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-17 10:30:08 +01:00
parent 09a2f0ea5e
commit 857a82ecff

View File

@@ -30,6 +30,11 @@
<h2>{{ t('deck', 'Loading board') }}</h2>
<p />
</div>
<div v-else-if="!board" key="notfound" class="emptycontent">
<div class="icon icon-deck" />
<h2>{{ t('deck', 'Board not found') }}</h2>
<p />
</div>
<NcEmptyContent v-else-if="isEmpty" key="empty">
<template #icon>
<DeckIcon />
@@ -70,11 +75,6 @@
</Draggable>
</Container>
</div>
<div v-else key="notfound" class="emptycontent">
<div class="icon icon-deck" />
<h2>{{ t('deck', 'Board not found') }}</h2>
<p />
</div>
</transition>
<GlobalSearchResults />
</div>
@@ -140,12 +140,6 @@ export default {
},
watch: {
id(newValue, oldValue) {
if (this.session) {
// close old session
this.session.close()
}
this.session = createSession(newValue)
this.fetchData()
},
showArchived() {
@@ -165,11 +159,16 @@ export default {
try {
await this.$store.dispatch('loadBoardById', this.id)
await this.$store.dispatch('loadStacks', this.id)
this.session?.close()
this.session = createSession(this.id)
} catch (e) {
this.loading = false
console.error(e)
showError(e)
} finally {
this.loading = false
}
this.loading = false
},
onDropStack({ removedIndex, addedIndex }) {