Move note check to computed prop

This commit is contained in:
Roman Cervantes 2019-12-27 10:30:38 -06:00
parent e3bcde4224
commit 01be6fc7e5

View file

@ -36,8 +36,7 @@
<div class="details" v-if="game"> <div class="details" v-if="game">
<game-description /> <game-description />
<div class="markdown" v-if="notes && game && notes[game.id]"> <div class="markdown" v-if="hasNote">
<h3>Notes</h3>
<vue-markdown :source="notes[game.id].text" /> <vue-markdown :source="notes[game.id].text" />
</div> </div>
<game-details /> <game-details />
@ -116,6 +115,10 @@ export default {
return this.gameLists[this.platform.code]; return this.gameLists[this.platform.code];
}, },
hasNote() {
return this.notes && this.game && this.notes[this.game.id] && this.notes[this.game.id].text;
},
list() { list() {
return this.activePlatform[this.listId]; return this.activePlatform[this.listId];
}, },