mirror of
https://github.com/romancm/gamebrary
synced 2024-11-27 21:50:24 +00:00
* 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:
parent
0969535e8b
commit
a1bf2a80be
3 changed files with 27 additions and 5 deletions
|
@ -45,7 +45,7 @@
|
|||
@click="back"
|
||||
>
|
||||
<i class="fas fa-chevron-left" />
|
||||
{{ $t('back') }}
|
||||
{{ $t('global.back') }}
|
||||
</button>
|
||||
|
||||
<igdb-credit linkable />
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
@click="cancel"
|
||||
>
|
||||
<i class="fas fa-chevron-left" />
|
||||
{{ $t('back') }}
|
||||
{{ $t('global.back') }}
|
||||
</button>
|
||||
|
||||
<modal
|
||||
|
|
|
@ -47,9 +47,31 @@ export default {
|
|||
return new Promise((resolve, reject) => {
|
||||
axios.get(`${FIREBASE_URL}/search?searchText=${searchText}&platformId=${state.platform.id}`)
|
||||
.then(({ data }) => {
|
||||
commit('SET_SEARCH_RESULTS', data);
|
||||
commit('CACHE_GAME_DATA', data);
|
||||
resolve();
|
||||
const originalData = data.slice();
|
||||
if (state.platform.id === 37) {
|
||||
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);
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue