mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-08 20:07:46 -06:00
feat: Migrate to go_router
This commit is contained in:
@@ -21,7 +21,7 @@ class GlobalSettings with HiveObjectMixin {
|
||||
bool showOnboarding;
|
||||
|
||||
@HiveField(4)
|
||||
String? currentLoggedInUser;
|
||||
String? loggedInUserId;
|
||||
|
||||
@HiveField(5)
|
||||
FileDownloadType defaultDownloadType;
|
||||
@@ -37,7 +37,7 @@ class GlobalSettings with HiveObjectMixin {
|
||||
this.preferredThemeMode = ThemeMode.system,
|
||||
this.preferredColorSchemeOption = ColorSchemeOption.classic,
|
||||
this.showOnboarding = true,
|
||||
this.currentLoggedInUser,
|
||||
this.loggedInUserId,
|
||||
this.defaultDownloadType = FileDownloadType.alwaysAsk,
|
||||
this.defaultShareType = FileDownloadType.alwaysAsk,
|
||||
this.enforceSinglePagePdfUpload = false,
|
||||
|
||||
@@ -20,16 +20,16 @@ class LocalUserAccount extends HiveObject {
|
||||
@HiveField(7)
|
||||
UserModel paperlessUser;
|
||||
|
||||
@HiveField(8, defaultValue: 2)
|
||||
int apiVersion;
|
||||
|
||||
LocalUserAccount({
|
||||
required this.id,
|
||||
required this.serverUrl,
|
||||
required this.settings,
|
||||
required this.paperlessUser,
|
||||
required this.apiVersion,
|
||||
});
|
||||
|
||||
static LocalUserAccount get current =>
|
||||
Hive.box<LocalUserAccount>(HiveBoxes.localUserAccount).get(
|
||||
Hive.box<GlobalSettings>(HiveBoxes.globalSettings)
|
||||
.getValue()!
|
||||
.currentLoggedInUser)!;
|
||||
bool get hasMultiUserSupport => apiVersion >= 3;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class LocalUserAppState extends HiveObject {
|
||||
final currentLocalUserId =
|
||||
Hive.box<GlobalSettings>(HiveBoxes.globalSettings)
|
||||
.getValue()!
|
||||
.currentLoggedInUser!;
|
||||
.loggedInUserId!;
|
||||
return Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState)
|
||||
.get(currentLocalUserId)!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user