Merge branch 'krille/dont-upload-keys-after-logout' into 'main'

fix: Do not upload keys after logout

Closes #213

See merge request famedly/company/frontend/famedlysdk!866
This commit is contained in:
td 2021-10-29 13:21:01 +00:00
commit 3130931f0d
1 changed files with 2 additions and 0 deletions

View File

@ -236,6 +236,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'])