Null checks

This commit is contained in:
Roman Cervantes 2018-12-19 09:30:22 -07:00
parent 4652fb5af9
commit 96d1075db4
2 changed files with 12 additions and 3 deletions

View file

@ -29,7 +29,7 @@
@click="removeGame"
title="Delete game"
class="small error hollow"
:class="{ accent: !settings.nightMode }"
:class="{ accent: settings && !settings.nightMode }"
>
<i class="fas fa-trash" />
</button>

View file

@ -16,7 +16,7 @@
Boom
</div> -->
<template v-else-if="gameLists && gameLists[platform.code]">
<template>
<list
:name="list.name"
:games="list.games"
@ -39,6 +39,7 @@
<script>
import { dragscroll } from 'vue-dragscroll';
import AddList from '@/components/Lists/AddList';
import Panel from '@/components/Panel/Panel';
import { $success, $error, swal } from '@/shared/modals';
import List from '@/components/GameBoard/List';
import draggable from 'vuedraggable';
@ -57,6 +58,7 @@ export default {
draggable,
List,
AddList,
Panel,
},
directives: {
@ -86,7 +88,9 @@ export default {
...mapState(['user', 'gameLists', 'platform', 'settings']),
list() {
return this.gameLists[this.platform.code];
return this.gameLists && this.gameLists[this.platform.code]
? this.gameLists[this.platform.code]
: null;
},
nightMode() {
@ -207,6 +211,11 @@ export default {
color: $color-white;
}
.panel {
margin-right: $gp;
width: 300px;
}
.lists {
user-select: none;
display: flex;