fix timer stuffs

This commit is contained in:
Sorunome 2020-06-12 17:32:35 +02:00
parent aed1cf1270
commit 221d6c275b
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 1 additions and 3 deletions

View File

@ -406,7 +406,6 @@ class KeyVerification {
Future<void> maybeRequestSSSSSecrets([int i = 0]) async { Future<void> maybeRequestSSSSSecrets([int i = 0]) async {
final requestInterval = <int>[10, 60]; final requestInterval = <int>[10, 60];
print('Attempting to request ssss secrets...');
if ((!encryption.crossSigning.enabled || if ((!encryption.crossSigning.enabled ||
(encryption.crossSigning.enabled && (encryption.crossSigning.enabled &&
(await encryption.crossSigning.isCached()))) && (await encryption.crossSigning.isCached()))) &&
@ -414,12 +413,11 @@ class KeyVerification {
(encryption.keyManager.enabled && (encryption.keyManager.enabled &&
(await encryption.keyManager.isCached())))) { (await encryption.keyManager.isCached())))) {
// no need to request cache, we already have it // no need to request cache, we already have it
print('Not needed, we already have them');
return; return;
} }
unawaited(encryption.ssss.maybeRequestAll( unawaited(encryption.ssss.maybeRequestAll(
_verifiedDevices.whereType<DeviceKeys>().toList())); _verifiedDevices.whereType<DeviceKeys>().toList()));
if (requestInterval.length >= i) { if (requestInterval.length <= i) {
return; return;
} }
Timer(Duration(seconds: requestInterval[i]), () => maybeRequestSSSSSecrets(i + 1)); Timer(Duration(seconds: requestInterval[i]), () => maybeRequestSSSSSecrets(i + 1));