#74: 3DS and New 3DS libraries need to be merged (#113)

* Fixed back strings

* Merged 3DS and New 3DS

* Apply suggestions from code review

Co-Authored-By: Roman Cervantes <roman.cervantes@keap.com>
This commit is contained in:
Matthew Bunge 2019-05-20 10:27:34 -07:00 committed by GitHub
parent 0969535e8b
commit a1bf2a80be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 5 deletions

View file

@ -45,7 +45,7 @@
@click="back" @click="back"
> >
<i class="fas fa-chevron-left" /> <i class="fas fa-chevron-left" />
{{ $t('back') }} {{ $t('global.back') }}
</button> </button>
<igdb-credit linkable /> <igdb-credit linkable />

View file

@ -83,7 +83,7 @@
@click="cancel" @click="cancel"
> >
<i class="fas fa-chevron-left" /> <i class="fas fa-chevron-left" />
{{ $t('back') }} {{ $t('global.back') }}
</button> </button>
<modal <modal

View file

@ -47,9 +47,31 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.get(`${FIREBASE_URL}/search?searchText=${searchText}&platformId=${state.platform.id}`) axios.get(`${FIREBASE_URL}/search?searchText=${searchText}&platformId=${state.platform.id}`)
.then(({ data }) => { .then(({ data }) => {
commit('SET_SEARCH_RESULTS', data); const originalData = data.slice();
commit('CACHE_GAME_DATA', data); if (state.platform.id === 37) {
resolve(); axios.get('${FIREBASE_URL}/search?searchText=${searchText}&platformId=137')
.then(({ data }) => {
data.forEach((element)=> {
let found = false;
for (let i = 0; i < originalData.length; i++) {
if (originalData[i].id === element.id) {
found = true;
break;
}
}
if (!found) {
originalData.push(element);
}
});
commit('SET_SEARCH_RESULTS', originalData);
commit('CACHE_GAME_DATA', originalData);
resolve();
}).catch(reject);
} else {
commit('SET_SEARCH_RESULTS', data);
commit('CACHE_GAME_DATA', data);
resolve();
}
}).catch(reject); }).catch(reject);
}); });
}, },