fix for data not updating first time
This commit is contained in:
@@ -3,6 +3,13 @@
|
|||||||
import AutoComplete from "simple-svelte-autocomplete";
|
import AutoComplete from "simple-svelte-autocomplete";
|
||||||
import DisplayData from "./DisplayData.svelte";
|
import DisplayData from "./DisplayData.svelte";
|
||||||
$: {
|
$: {
|
||||||
|
if (myValue > 0 && myValue !== currentValue) {
|
||||||
|
invoke("search", { index: myValue }).then((r) => {
|
||||||
|
currentValue = myValue;
|
||||||
|
pokemonData = r;
|
||||||
|
console.log(pokemonData);
|
||||||
|
});
|
||||||
|
}
|
||||||
pokemonStatus = {
|
pokemonStatus = {
|
||||||
types: pokemonData?.types ? pokemonData.types : [],
|
types: pokemonData?.types ? pokemonData.types : [],
|
||||||
hp: hp_final,
|
hp: hp_final,
|
||||||
@@ -42,15 +49,6 @@
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$: {
|
|
||||||
if (myValue > 0 && myValue !== currentValue) {
|
|
||||||
invoke("search", { index: myValue }).then((r) => {
|
|
||||||
currentValue = myValue;
|
|
||||||
pokemonData = r;
|
|
||||||
console.log(pokemonData);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user