feat: Add login integration test (WIP), update notes feature

This commit is contained in:
Anton Stubenbord
2024-01-06 19:23:30 +01:00
parent 64d49a4a24
commit 497777c52b
20 changed files with 465 additions and 418 deletions

View File

@@ -0,0 +1,25 @@
import 'dart:io';
import 'package:hive/hive.dart';
import 'package:hive_flutter/adapters.dart';
import 'package:paperless_mobile/core/database/hive/hive_config.dart';
import 'package:paperless_mobile/core/database/tables/global_settings.dart';
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
import 'package:paperless_mobile/core/database/tables/local_user_app_state.dart';
Future<void> initHive(Directory directory, String defaultLocale) async {
Hive.init(directory.path);
registerHiveAdapters();
await Hive.openBox<LocalUserAccount>(HiveBoxes.localUserAccount);
await Hive.openBox<LocalUserAppState>(HiveBoxes.localUserAppState);
await Hive.openBox<bool>(HiveBoxes.hintStateBox);
await Hive.openBox<String>(HiveBoxes.hosts);
final globalSettingsBox =
await Hive.openBox<GlobalSettings>(HiveBoxes.globalSettings);
if (!globalSettingsBox.hasValue) {
await globalSettingsBox.setValue(
GlobalSettings(preferredLocaleSubtag: defaultLocale),
);
}
}