Close the client before removing its data. Probably safer.

This commit is contained in:
Benoit Marty 2023-06-21 09:35:21 +02:00 committed by Benoit Marty
parent 979ebe4adb
commit f9423fc15e

View file

@ -354,9 +354,9 @@ class RustMatrixClient constructor(
} catch (failure: Throwable) {
Timber.e(failure, "Fail to call logout on HS. Still delete local files.")
}
baseDirectory.deleteSessionDirectory(userID = client.userId(), deleteCryptoDb = true)
sessionStore.removeSession(client.userId())
close()
baseDirectory.deleteSessionDirectory(userID = sessionId.value, deleteCryptoDb = true)
sessionStore.removeSession(sessionId.value)
}
override suspend fun loadUserDisplayName(): Result<String> = withContext(dispatchers.io) {