Working version before modification.

This commit is contained in:
Stan
2026-04-20 21:04:54 +02:00
parent 28d167f11f
commit e7127f3215
30 changed files with 7046 additions and 1201 deletions
+25
View File
@@ -0,0 +1,25 @@
/*
* User entry point — bootstraps the task-processing workspace.
*
* Opens the shared IndexedDB for admin entity cache, then initializes the
* user module which manages task processing: open task, fill in records,
* attach images, save as draft or final.
*/
import { state } from './js/state.js';
import { openDatabase } from './js/db.js';
import { initUser } from './js/user.js';
document.addEventListener('DOMContentLoaded', async () => {
/* Open the shared IndexedDB so admin entity cache is accessible. */
state.db = await openDatabase();
await initUser();
});
/* Re-init when navigating back (fixes stale localStorage after bfcache) */
window.addEventListener('pageshow', async (e) => {
if (e.persisted) {
state.db = await openDatabase();
await initUser();
}
});