You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But sometimes (randomly?) it doesn't reflect the new value of "totalWin" state (on iOS Safari). I debugged this and removed more and more code until I found what caused it. If I instead change to the code to below it works always (the only changed thing is that I removed the "Test" text from the sibling html node):
Don't know how to reproduce it in a simpler way. but pretty sure it's a bug in Svelte. I solved it by creating a component for just the "totalWin" which seems to work fine:
<script lang="ts">
import type { BetService } from "../service/bet-service.svelte";
import type { CurrencyService } from "../service/currency-service";
interface Props {
bet: BetService<unknown>;
currency: CurrencyService;
}
let { bet, currency }: Props = $props();
</script>
<span>{currency.formatCurrency(bet.totalWin)}</span>
Describe the bug
I have a piece of html below ("totalWin" is a piece of $state on the "bet"-object) and most of the time the value updates as expected:
But sometimes (randomly?) it doesn't reflect the new value of "totalWin" state (on iOS Safari). I debugged this and removed more and more code until I found what caused it. If I instead change to the code to below it works always (the only changed thing is that I removed the "Test" text from the sibling html node):
How and why, you have any idea?
Reproduction
Sorry, this is a pretty big project.
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: