fix(train): the person's key read before one is chosen to write with
TrainKeys.keyToWrite refused with KeysMissing where nothing had read the key rows yet, the account's keys on the device all the same, and would have made a second key beside one already there had it unlocked. It reads them first now whenever no key is chosen yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
39b43217f6
commit
c7acec3a05
1 changed files with 17 additions and 1 deletions
|
|
@ -61,8 +61,13 @@ class TrainKeys(
|
|||
_unlocked && _madeAt(keyId) != null && cipher.has(keyId);
|
||||
|
||||
/// The key to seal with, made and kept the first time; throws
|
||||
/// [KeysMissing] without the account's keys.
|
||||
/// [KeysMissing] without the account's keys. The key rows are read first
|
||||
/// where none was chosen yet, so that no second key is made beside one
|
||||
/// already there.
|
||||
Future<String> keyToWrite() async {
|
||||
if (_writeKey == null) {
|
||||
await refresh();
|
||||
}
|
||||
if (_writeKey case final key?) {
|
||||
return key;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue