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