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 a05d64250f
commit 911ed7a2f4

View File

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