mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-17 12:28:49 +00:00
fix: logout
This commit is contained in:
@ -77,14 +77,17 @@ class LoginData extends ValueNotifier<LoginAccount?> {
|
|||||||
|
|
||||||
LoginData() : super(null) {
|
LoginData() : super(null) {
|
||||||
super.addListener(() async {
|
super.addListener(() async {
|
||||||
final data = json.encode(LoginAccount.toJson(value));
|
if (value != null) {
|
||||||
await _storage.write(key: _storageKey, value: data);
|
final data = json.encode(LoginAccount.toJson(value));
|
||||||
|
await _storage.write(key: _storageKey, value: data);
|
||||||
|
} else {
|
||||||
|
await _storage.delete(key: _storageKey);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> logout() async {
|
void logout() {
|
||||||
super.value = null;
|
super.value = null;
|
||||||
await _storage.delete(key: _storageKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> load() async {
|
Future<void> load() async {
|
||||||
|
Reference in New Issue
Block a user