fix: use singleton IndexedDB connection to prevent blocking

Replaced open/close-per-operation pattern with a single persistent
connection held for the app lifetime. This prevents the DB upgrade
(v1→v2) from being blocked by lingering connections, and eliminates
transaction contention.

Also added onblocked handler that surfaces a clear error instead of
hanging indefinitely.
This commit is contained in:
2026-08-01 18:52:12 +08:00
parent a7697fd4a1
commit 97e294f1d6
3 changed files with 75 additions and 87 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,7 +5,7 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MJPEG Stream Viewer</title>
<script type="module" crossorigin src="/assets/index-CW6NDYF0.js"></script>
<script type="module" crossorigin src="/assets/index-B6qcBY8r.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BTgh_FTp.css">
</head>
<body>