Game board load bug fix

This commit is contained in:
Roman Cervantes 2019-09-03 21:09:31 -07:00
parent de3002280b
commit 54e9c27afb

View file

@ -133,7 +133,7 @@ export default {
mounted() {
this.$store.commit('CLEAR_ACTIVE_LIST_INDEX');
if (this.list && this.platform) {
if (this.platform) {
this.load();
this.setPageTitle();
} else {
@ -215,7 +215,10 @@ export default {
},
load() {
const flattenedList = this.list.map(({ games }) => games).flat();
const flattenedList = this.list
? this.list.map(({ games }) => games).flat()
: [];
const dedupedList = Array.from(new Set(flattenedList));
return dedupedList.length > this.queryLimit
@ -224,6 +227,7 @@ export default {
},
loadGames(gameList) {
if (gameList && gameList.length > 0) {
this.loading = true;
this.$store.dispatch('LOAD_GAMES', gameList.toString())
@ -233,6 +237,7 @@ export default {
.catch(() => {
this.$bus.$emit('TOAST', { message: 'Error loading games', type: 'error' });
});
}
},
loadGamesInChunks(gameList) {