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 { scrollingTimeFrameStore } from "$lib/store/scrollingTimeFrameStore";
|
||||||
import { lastMonthPaymentsStore } from "$lib/store/lastMonthPaymentsStore";
|
import { lastMonthPaymentsStore } from "$lib/store/lastMonthPaymentsStore";
|
||||||
import { thisMonthPaymentsStore } from "$lib/store/thisMonthPaymentsStore";
|
import { thisMonthPaymentsStore } from "$lib/store/thisMonthPaymentsStore";
|
||||||
|
|
||||||
|
let forceupdate = false;
|
||||||
|
thisMonthPaymentsStore.subscribe(() => {
|
||||||
|
forceupdate = !forceupdate;
|
||||||
|
});
|
||||||
|
lastMonthPaymentsStore.subscribe(() => {
|
||||||
|
forceupdate = !forceupdate;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
<Payments date={$scrollingTimeFrameStore.from} payments={$lastMonthPaymentsStore} />
|
{#if forceupdate}
|
||||||
<Payments date={$scrollingTimeFrameStore.to} payments={$thisMonthPaymentsStore} />
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user