mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 12:13:08 +00:00
Game board load bug fix
This commit is contained in:
parent
de3002280b
commit
54e9c27afb
1 changed files with 15 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue