mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
chore: Ask for storage persistence
This commit is contained in:
parent
ccfcaf9373
commit
ad93f71d05
1 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|||
import 'package:hive/hive.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
||||
FlutterHiveCollectionsDatabase(
|
||||
|
@ -29,7 +30,11 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||
HiveAesCipher? hiverCipher;
|
||||
try {
|
||||
// Workaround for secure storage is calling Platform.operatingSystem on web
|
||||
if (kIsWeb) throw MissingPluginException();
|
||||
if (kIsWeb) {
|
||||
// ignore: unawaited_futures
|
||||
html.window.navigator.storage?.persist();
|
||||
throw MissingPluginException();
|
||||
}
|
||||
|
||||
const secureStorage = FlutterSecureStorage();
|
||||
final containsEncryptionKey =
|
||||
|
|
Loading…
Reference in a new issue