ui: add alert/prompt/confirm helper function (#1018)

This commit is contained in:
undefined authored and GitHub committed 2025-07-19 11:27:37 +01:00
1 parent 2d7979105e
commit d4271b3fbd
12 files changed
+176 -196

No files matched your search

+3 -8
View File
@@ -1,6 +1,5 @@
import { openDB as _open } from 'idb';
import { InfoDialog } from 'vj/components/dialog';
import { tpl } from 'vj/utils';
import { alert } from 'vj/components/dialog';
export const openDB = _open('hydro', 1, {
upgrade(db, oldVersion) {
@@ -21,15 +20,11 @@ export const openDB = _open('hydro', 1, {
},
blocked(currentVersion, blockedVersion) {
console.error('IDB Blocked by version', blockedVersion, 'want', currentVersion);
new InfoDialog({
$body: tpl.typoMsg('Some other opened tabs locked the database. Please close them.'),
}).open();
alert('Some other opened tabs locked the database. Please close them.');
},
blocking(currentVersion, blockedVersion) {
console.error('IDB Blocking version', blockedVersion);
new InfoDialog({
$body: tpl.typoMsg('Please close or refresh this tab to perform the upgrade.'),
}).open();
alert('Please close or refresh this tab to perform the upgrade.');
},
terminated() {
console.error('IDB Terminated');