Skip to content
Snippets Groups Projects
Unverified Commit 20918b83 authored by KitsuneAlex's avatar KitsuneAlex
Browse files

Merge in latest changes from main

parents 0739d114 e55c1ea7
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Duplicated libraries in the About > Licenses are now differentiable
- Update selected account when deleting account
### Security
......
......@@ -154,7 +154,14 @@ class MatrixMessengerSettingsHolderImpl(
}
override suspend fun delete(userId: UserId) = update<MatrixMessengerSettingsBase> {
it.copy(accounts = it.accounts - userId)
val accounts = it.accounts - userId
val selectedAccount =
if (it.selectedAccount == userId) accounts.keys.firstOrNull()
else it.selectedAccount
it.copy(
accounts = accounts,
selectedAccount = selectedAccount,
)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment