mirror of
https://github.com/romancm/gamebrary
synced 2024-11-30 23:09:14 +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"
|
@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 />
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue