fix: Do not upload keys after logout

This should fix a race condition where uploading keys is still ongoing
after user has already logged out.
This commit is contained in:
Krille Fear 2021-10-27 11:50:06 +02:00
parent 06281d1361
commit 176dbbeda9
1 changed files with 2 additions and 0 deletions

View File

@ -237,6 +237,8 @@ class OlmManager {
if (updateDatabase) {
await client.database?.updateClientKeys(pickledOlmAccount!);
}
// Workaround: Make sure we stop if we got logged out in the meantime.
if (!client.isLogged()) return true;
final response = await client.uploadKeys(
deviceKeys: uploadDeviceKeys
? MatrixDeviceKeys.fromJson(keysContent['device_keys'])