fixed all the last big bugs before going to PWA
This commit is contained in:
+7
-3
@@ -160,7 +160,7 @@
|
||||
}
|
||||
document.getElementById('likeButton').onclick = function () {
|
||||
if (LoadedSuccessfully) {
|
||||
saveToIndexedDB("likes", CurrentPokemon);
|
||||
//saveToIndexedDB("likes", CurrentPokemon);
|
||||
storeToApi("likes",CurrentPokemon);
|
||||
loadNewPokemon();
|
||||
}
|
||||
@@ -173,7 +173,7 @@
|
||||
}
|
||||
document.getElementById('favoriteButton').onclick = function () {
|
||||
if (LoadedSuccessfully) {
|
||||
saveToIndexedDB("favorites", CurrentPokemon);
|
||||
//saveToIndexedDB("favorites", CurrentPokemon);
|
||||
storeToApi("favorites",CurrentPokemon);
|
||||
loadNewPokemon();
|
||||
}
|
||||
@@ -263,7 +263,11 @@
|
||||
|
||||
fetch("https://633bde0df11701a65f69abe8.mockapi.io/api/v1/"+storeName+"/", requestOptions)
|
||||
.then(response => response.text())
|
||||
.then(result => console.log(result))
|
||||
.then(result => {
|
||||
let addedPokemon = JSON.parse(result);
|
||||
console.log(addedPokemon);
|
||||
saveToIndexedDB(storeName,addedPokemon);
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user