Merge commit '040c18d80fec095a4c6ea715a4e876a51e7332ba' into fluffychat-merge-2
This commit is contained in:
commit
5d30c1da86
2 changed files with 24 additions and 34 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
|
@ -119,6 +117,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
while (client.prevBatch == null) {
|
||||
await client.onSync.stream.first;
|
||||
}
|
||||
await client.updateUserDeviceKeys();
|
||||
_wipe = wipe;
|
||||
titleText = null;
|
||||
_recoveryKeyStored = false;
|
||||
|
|
@ -365,20 +364,12 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
Logs().v(
|
||||
'Cross signing is already enabled. Try to self-sign',
|
||||
);
|
||||
try {
|
||||
await bootstrap
|
||||
.client
|
||||
.encryption!
|
||||
.crossSigning
|
||||
.selfSign(recoveryKey: key);
|
||||
Logs().d('Successful selfsigned');
|
||||
} catch (e, s) {
|
||||
Logs().e(
|
||||
'Unable to self sign with recovery key after successfully open existing SSSS',
|
||||
e,
|
||||
s,
|
||||
);
|
||||
}
|
||||
await bootstrap
|
||||
.client
|
||||
.encryption!
|
||||
.crossSigning
|
||||
.selfSign(recoveryKey: key);
|
||||
Logs().d('Successful selfsigned');
|
||||
}
|
||||
} on InvalidPassphraseException catch (e) {
|
||||
setState(
|
||||
|
|
@ -451,26 +442,25 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
if (success != true) return;
|
||||
if (!mounted) return;
|
||||
|
||||
final waitForSecret = Completer();
|
||||
final secretsSub = client
|
||||
.encryption!
|
||||
.ssss
|
||||
.onSecretStored
|
||||
.stream
|
||||
.listen((event) async {
|
||||
if (await client.encryption!.keyManager
|
||||
.isCached() &&
|
||||
await client.encryption!.crossSigning
|
||||
.isCached()) {
|
||||
waitForSecret.complete();
|
||||
}
|
||||
});
|
||||
|
||||
final result = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => waitForSecret.future,
|
||||
future: () async {
|
||||
final allCached =
|
||||
await client.encryption!.keyManager
|
||||
.isCached() &&
|
||||
await client.encryption!.crossSigning
|
||||
.isCached();
|
||||
if (!allCached) {
|
||||
await client
|
||||
.encryption!
|
||||
.ssss
|
||||
.onSecretStored
|
||||
.stream
|
||||
.first;
|
||||
}
|
||||
return;
|
||||
},
|
||||
);
|
||||
await secretsSub.cancel();
|
||||
if (!mounted) return;
|
||||
if (!result.isError) _goBackAction(true);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ dependencies:
|
|||
highlight: ^0.7.0
|
||||
html: ^0.15.4
|
||||
http: ^1.6.0
|
||||
image: ^4.7.1
|
||||
image: ^4.7.2
|
||||
image_picker: ^1.2.1
|
||||
intl: any
|
||||
just_audio: ^0.10.5
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue