generated from dave/wails-template
Add force redraw on navigate
This commit is contained in:
@@ -3,11 +3,24 @@
|
||||
import { scrollingTimeFrameStore } from "$lib/store/scrollingTimeFrameStore";
|
||||
import { lastMonthPaymentsStore } from "$lib/store/lastMonthPaymentsStore";
|
||||
import { thisMonthPaymentsStore } from "$lib/store/thisMonthPaymentsStore";
|
||||
|
||||
let forceupdate = false;
|
||||
thisMonthPaymentsStore.subscribe(() => {
|
||||
forceupdate = !forceupdate;
|
||||
});
|
||||
lastMonthPaymentsStore.subscribe(() => {
|
||||
forceupdate = !forceupdate;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-2">
|
||||
{#if forceupdate}
|
||||
<Payments date={$scrollingTimeFrameStore.from} payments={$lastMonthPaymentsStore} />
|
||||
<Payments date={$scrollingTimeFrameStore.to} payments={$thisMonthPaymentsStore} />
|
||||
{:else}
|
||||
<Payments date={$scrollingTimeFrameStore.from} payments={$lastMonthPaymentsStore} />
|
||||
<Payments date={$scrollingTimeFrameStore.to} payments={$thisMonthPaymentsStore} />
|
||||
{/if}
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user