diff --git a/lib/src/database/indexeddb_box.dart b/lib/src/database/indexeddb_box.dart index ba04971b..f4c3ccbe 100644 --- a/lib/src/database/indexeddb_box.dart +++ b/lib/src/database/indexeddb_box.dart @@ -158,7 +158,7 @@ class Box { Future delete(String key, [Transaction? txn]) async { if (boxCollection._txnCache != null) { boxCollection._txnCache!.add((txn) => delete(key, txn)); - _cache.remove(key); + _cache[key] = null; _cachedKeys?.remove(key); return; } @@ -177,7 +177,9 @@ class Box { Future deleteAll(List keys, [Transaction? txn]) async { if (boxCollection._txnCache != null) { boxCollection._txnCache!.add((txn) => deleteAll(keys, txn)); - keys.forEach(_cache.remove); + for (final key in keys) { + _cache[key] = null; + } _cachedKeys?.removeAll(keys); return; }