mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
fix: Init hive
This commit is contained in:
parent
053b71aad5
commit
59f9a9f447
2 changed files with 7 additions and 5 deletions
|
@ -2,8 +2,10 @@ import 'dart:convert';
|
|||
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:matrix/encryption/utils/key_verification.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import 'famedlysdk_store.dart';
|
||||
import 'matrix_sdk_extensions.dart/flutter_matrix_hive_database.dart';
|
||||
|
@ -11,6 +13,11 @@ import 'matrix_sdk_extensions.dart/flutter_matrix_hive_database.dart';
|
|||
abstract class ClientManager {
|
||||
static const String clientNamespace = 'im.fluffychat.store.clients';
|
||||
static Future<List<Client>> getClients() async {
|
||||
if (PlatformInfos.isLinux) {
|
||||
Hive.init((await getApplicationSupportDirectory()).path);
|
||||
} else {
|
||||
await Hive.initFlutter();
|
||||
}
|
||||
final clientNames = <String>{};
|
||||
try {
|
||||
final rawClientNames = await Store().getItem(clientNamespace);
|
||||
|
|
|
@ -49,11 +49,6 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
|
|||
Client client) async {
|
||||
if (!kIsWeb && !_hiveInitialized) {
|
||||
Logs().i('Init Hive database...');
|
||||
if (PlatformInfos.isLinux) {
|
||||
Hive.init((await getApplicationSupportDirectory()).path);
|
||||
} else {
|
||||
await Hive.initFlutter();
|
||||
}
|
||||
_hiveInitialized = true;
|
||||
}
|
||||
HiveCipher hiverCipher;
|
||||
|
|
Loading…
Reference in a new issue