Display an error if the character can't be found or viewed

This commit is contained in:
Thaum Rystra
2020-05-21 13:36:59 +02:00
parent b640ce457f
commit c4a52ca744
3 changed files with 41 additions and 16 deletions

View File

@@ -2,7 +2,35 @@
<div class="character-sheet fill-height">
<v-fade-transition mode="out-in">
<div
v-if="$subReady.singleCharacter"
v-if="!$subReady.singleCharacter"
key="character-loading"
class="fill-height layout justify-center align-center"
>
<v-progress-circular
indeterminate
color="primary"
size="64"
/>
</div>
<div
v-else-if="!creature"
>
<v-layout
column
align-center
justify-center
>
<h2 style="margin: 48px 28px 16px">
Character not found
</h2>
<h3>
Either this character does not exist, or you don't have permission
to view it.
</h3>
</v-layout>
</div>
<div
v-else
key="character-tabs"
class="fill-height"
>
@@ -29,17 +57,6 @@
</v-tab-item>
</v-tabs-items>
</div>
<div
v-else
key="character-loading"
class="fill-height layout justify-center align-center"
>
<v-progress-circular
indeterminate
color="primary"
size="64"
/>
</div>
</v-fade-transition>
</div>
</template>
@@ -94,7 +111,7 @@
},
},
creature(){
return Creatures.findOne(this.creatureId) || {};
return Creatures.findOne(this.creatureId);
},
editPermission(){
try {

View File

@@ -1,5 +1,6 @@
<template lang="html">
<v-tabs
v-if="creature"
slot="extension"
:value="value"
centered
@@ -29,13 +30,20 @@
</template>
<script>
import Creatures from '/imports/api/creature/Creatures.js';
export default {
props: {
value: {
type: Number,
required: true,
},
}
},
meteor: {
creature(){
return Creatures.findOne(this.$route.params.id);
},
},
}
</script>

View File

@@ -1,5 +1,5 @@
<template lang="html">
<v-toolbar-items>
<v-toolbar-items v-if="creature">
<v-btn
flat
icon
@@ -142,7 +142,7 @@ export default {
},
},
creature(){
return Creatures.findOne(this.creatureId) || {};
return Creatures.findOne(this.creatureId);
},
editPermission(){
try {