6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 83e2c07e

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-10-27 10:27:02 +0100
Resolved PR comments

Changed files

comwell_key_app/lib/authentication/authentication_repository.dart | 7 +------
 comwell_key_app/lib/database/comwell_db.dart                      | 5 -----
 comwell_key_app/lib/utils/locator.dart                            | 7 +------
 3 files changed, 2 insertions(+), 17 deletions(-)

Diff

diff --git a/comwell_key_app/lib/authentication/authentication_repository.dart b/comwell_key_app/lib/authentication/authentication_repository.dart
index 63c58507..a7686335 100644
--- a/comwell_key_app/lib/authentication/authentication_repository.dart
+++ b/comwell_key_app/lib/authentication/authentication_repository.dart
@@ -114,8 +114,6 @@ class AuthenticationRepository {
await secureStorage.deleteAll();
await database.deleteDatabase();
- // Reset the database singleton to create a fresh instance
- resetDatabase();
// await msAuth.removeAccount();
@@ -137,10 +135,7 @@ class AuthenticationRepository {
// Even if logout fails, still clear local data and update status
await secureStorage.deleteAll();
await database.deleteDatabase();
-
- // Reset the database singleton to create a fresh instance
- resetDatabase();
-
+
if (forced) {
_controller.sink.add(AuthenticationStatus.forcedUnauthenticated);
} else {
diff --git a/comwell_key_app/lib/database/comwell_db.dart b/comwell_key_app/lib/database/comwell_db.dart
index 0562d61b..63602429 100644
--- a/comwell_key_app/lib/database/comwell_db.dart
+++ b/comwell_key_app/lib/database/comwell_db.dart
@@ -50,11 +50,6 @@ class ComwellDatabase extends _$ComwellDatabase {
await notificationPermissionDAO.delete(notificationPermissionEntity).go();
}
- /// Reset the database singleton in the locator
- static void resetSingleton() {
- // This will be called from locator to reset the singleton
- }
-
static Future<String> getCipher() async {
final cipher = await secureStorage.read(_cipherKey);
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 091fbde2..ea826842 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -37,12 +37,7 @@ void registerDatabase() {
}
}
-void resetDatabase() async {
- if (locator.isRegistered<ComwellDatabase>()) {
- locator.unregister<ComwellDatabase>();
- }
- registerDatabase();
-}
+
void setupLocator() {
locator.registerFactory<DeviceInfoPlugin>(() => DeviceInfoPlugin());