mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-16 17:09:31 +01:00
chore: Ask for storage persistence
This commit is contained in:
parent
fa2ed930eb
commit
692d6042c5
@ -8,6 +8,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:universal_html/html.dart' as html;
|
||||||
|
|
||||||
class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
||||||
FlutterHiveCollectionsDatabase(
|
FlutterHiveCollectionsDatabase(
|
||||||
@ -29,7 +30,11 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||||||
HiveAesCipher? hiverCipher;
|
HiveAesCipher? hiverCipher;
|
||||||
try {
|
try {
|
||||||
// Workaround for secure storage is calling Platform.operatingSystem on web
|
// 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();
|
const secureStorage = FlutterSecureStorage();
|
||||||
final containsEncryptionKey =
|
final containsEncryptionKey =
|
||||||
|
Loading…
Reference in New Issue
Block a user