feat: Add suggestions to server login page

This commit is contained in:
Anton Stubenbord
2023-06-02 16:37:03 +02:00
parent 31447087e1
commit d2b428c05b
7 changed files with 146 additions and 44 deletions

View File

@@ -244,7 +244,7 @@ class AuthenticationCubit extends Cubit<AuthenticationState> {
final userStateBox = Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState);
if (userAccountBox.containsKey(localUserId)) {
throw Exception("User with id $localUserId already exists!");
throw Exception("User already exists!");
}
final apiVersion = await _getApiVersion(sessionManager.client);
@@ -282,6 +282,10 @@ class AuthenticationCubit extends Cubit<AuthenticationState> {
),
);
});
final hostsBox = Hive.box<String>(HiveBoxes.hosts);
if (!hostsBox.values.contains(serverUrl)) {
await hostsBox.add(serverUrl);
}
return serverUser.id;
}