fix handling empty sessions
This commit is contained in:
@@ -29,7 +29,9 @@ class SettingsRepository extends _$SettingsRepository {
|
||||
if (oldSettings.kagiSession != newSettings.kagiSession) {
|
||||
await _flutterSecureStorage.write(
|
||||
key: _sessionStorageKey,
|
||||
value: newSettings.kagiSession,
|
||||
value: (newSettings.kagiSession?.isNotEmpty ?? false)
|
||||
? newSettings.kagiSession
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -48,9 +48,11 @@ void main() async {
|
||||
}
|
||||
|
||||
if (settings.kagiSession case final String session) {
|
||||
await ref
|
||||
.read(sessionServiceProvider.notifier)
|
||||
.setKagiSession(session);
|
||||
if (session.isNotEmpty) {
|
||||
await ref
|
||||
.read(sessionServiceProvider.notifier)
|
||||
.setKagiSession(session);
|
||||
}
|
||||
}
|
||||
|
||||
ref.read(sessionServiceProvider.notifier).initializationDone();
|
||||
|
||||
Reference in New Issue
Block a user