Fix race condition in income statement report view
This commit is contained in:
parent
12f1c85a81
commit
156a89e2ba
@ -90,6 +90,13 @@
|
|||||||
dtStart.value = dayjs(db.metadata.eofy_date).subtract(1, 'year').add(1, 'day').format('YYYY-MM-DD');
|
dtStart.value = dayjs(db.metadata.eofy_date).subtract(1, 'year').add(1, 'day').format('YYYY-MM-DD');
|
||||||
|
|
||||||
await updateReport(session);
|
await updateReport(session);
|
||||||
|
|
||||||
|
// Update report when dates etc. changed
|
||||||
|
// We initialise the watcher here only after dt and dtStart are initialised above
|
||||||
|
watch([dt, dtStart], async () => {
|
||||||
|
const session = await db.load();
|
||||||
|
await updateReport(session);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateReport(session: ExtendedDatabase) {
|
async function updateReport(session: ExtendedDatabase) {
|
||||||
@ -99,11 +106,5 @@
|
|||||||
report.value = reportingWorkflow.getReportAtStage(ReportingStage.InterimIncomeStatement, IncomeStatementReport) as IncomeStatementReport;
|
report.value = reportingWorkflow.getReportAtStage(ReportingStage.InterimIncomeStatement, IncomeStatementReport) as IncomeStatementReport;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update report when dates etc. changed
|
|
||||||
watch([dt, dtStart], async () => {
|
|
||||||
const session = await db.load();
|
|
||||||
updateReport(session);
|
|
||||||
});
|
|
||||||
|
|
||||||
load();
|
load();
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user