Restored old way of compiling game list

This commit is contained in:
Roman Cervantes 2018-11-26 23:44:27 -07:00
parent e5cb11850e
commit db333dd85b
2 changed files with 22 additions and 2 deletions

View file

@ -152,7 +152,17 @@ export default {
loadGameData() {
if (this.list) {
const gameList = this.list.map(({ games }) => games).filter(Boolean).join().replace(/(^,)|(,$)/g, '');
const gameList = [];
this.list.forEach((list) => {
if (list && list.games.length) {
list.games.forEach((id) => {
if (!gameList.includes(id)) {
gameList.push(id);
}
});
}
});
if (gameList.length > 0) {
this.loading = true;

View file

@ -86,7 +86,17 @@ export default {
},
loadGameData() {
const gameList = this.listData.map(({ games }) => games).filter(Boolean).join().replace(/(^,)|(,$)/g, '');
const gameList = [];
this.listData.forEach((list) => {
if (list && list.games.length) {
list.games.forEach((id) => {
if (!gameList.includes(id)) {
gameList.push(id);
}
});
}
});
if (gameList.length > 0) {
this.$store.dispatch('LOAD_PUBLIC_GAMES', gameList)