Skip to content

Commit

Permalink
fix: choosing transactions period in Firefox (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaclen authored Oct 27, 2022
1 parent 67ae606 commit 8c1e68a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
14 changes: 7 additions & 7 deletions sveltekit/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"sass": "^1.53.0",
"svelte": "^3.50.1",
"svelte": "^3.52.0",
"svelte-check": "^2.9.1",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.3.1",
Expand Down
9 changes: 8 additions & 1 deletion sveltekit/src/routes/transactions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,14 @@
options={periods}
bind:value={periodIndex}
on:change={async () => {
await getTransactions();
// HACK: there is a race condition (in Firefox) when changing the period.
// `periodIndex`, `dateFrom` and `dateTo` are not updated before
// getTransactions() is called. Adding a 1ms delay fixes the issue.
//
// REF https://github.com/Canutin/desktop/issues/119#issuecomment-1293639150
setTimeout(async () => {
await getTransactions();
}, 1);
}}
/>
<div class="transactions__summary">
Expand Down

0 comments on commit 8c1e68a

Please sign in to comment.