From 682d24267f39be714553952fa64647623bd98571 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Mon, 27 May 2024 11:36:25 +0000 Subject: [PATCH] Minor fix --- lib/platform/web/indexed_db.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/platform/web/indexed_db.dart b/lib/platform/web/indexed_db.dart index 6cff1b2..3406640 100644 --- a/lib/platform/web/indexed_db.dart +++ b/lib/platform/web/indexed_db.dart @@ -48,6 +48,7 @@ class IndexedDb { } Future init() async { + if (_inited) return; makeStoragePersist(); final req = version != null ? window.indexedDB.open(dbName, version!) @@ -156,6 +157,10 @@ class IndexedDb { } await Future.microtask(waitResult); + if (!ok) { + _inited = false; + throw req.error ?? ""; + } } Future openKeyCursor(String table, void Function(IDBCursor) callback, @@ -193,6 +198,10 @@ class IndexedDb { } await Future.microtask(waitResult); + if (!ok) { + _inited = false; + throw req.error ?? ""; + } } Future put(String table, JSAny value, {JSAny? key}) async {