Persist user keys after fetch
This commit is contained in:
parent
91e985ec88
commit
0b407ef98d
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
|
|||
import 'package:logging/logging.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
import 'package:photos/core/event_bus.dart';
|
||||
import 'package:photos/db/public_keys_db.dart';
|
||||
|
||||
import 'package:photos/events/user_authenticated_event.dart';
|
||||
import 'package:photos/models/key_attributes.dart';
|
||||
|
@ -58,7 +59,9 @@ class UserService {
|
|||
},
|
||||
),
|
||||
);
|
||||
return response.data["publicKey"];
|
||||
final publicKey = response.data["publicKey"];
|
||||
await PublicKeysDB.instance.setKey(email, publicKey);
|
||||
return publicKey;
|
||||
} on DioError catch (e) {
|
||||
_logger.info(e);
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue