drafts: Separate initialize function into data and UI pieces.

This will let us initialize the data before the UI is ready
to be initialized. We'll need to do this in an upcoming commit
where we clear a flag on page load before the reload code
initializes.
This commit is contained in:
evykassirer
2024-04-16 17:17:26 -07:00
committed by Tim Abbott
parent 0e369e7ff3
commit 14d83458c8
3 changed files with 7 additions and 3 deletions

View File

@@ -622,6 +622,8 @@ export function initialize(): void {
window.addEventListener("beforeunload", () => {
update_draft();
});
set_count(Object.keys(draft_model.get()).length);
}
export function initialize_ui(): void {
set_count(draft_model.getDraftCount());
}