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:
parent
06281d1361
commit
176dbbeda9
|
|
@ -237,6 +237,8 @@ class OlmManager {
|
||||||
if (updateDatabase) {
|
if (updateDatabase) {
|
||||||
await client.database?.updateClientKeys(pickledOlmAccount!);
|
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(
|
final response = await client.uploadKeys(
|
||||||
deviceKeys: uploadDeviceKeys
|
deviceKeys: uploadDeviceKeys
|
||||||
? MatrixDeviceKeys.fromJson(keysContent['device_keys'])
|
? MatrixDeviceKeys.fromJson(keysContent['device_keys'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue