fix: Show correct account name in "Open as ..." menu (#1139)

This commit is contained in:
Nik Clayton 2024-11-26 21:01:36 +01:00 committed by GitHub
parent e9b66b69e4
commit d03cf09708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 9 deletions

View File

@ -287,15 +287,7 @@ abstract class BaseActivity : AppCompatActivity(), MenuProvider {
val accounts = accountManager.accountsOrderedByActive
return when (accounts.size) {
0, 1 -> null
2 -> {
for (account in accounts) {
if (account !== accountManager.activeAccount) {
return getString(R.string.action_open_as, account.fullName)
}
}
null
}
2 -> getString(R.string.action_open_as, accounts.last().fullName)
else -> getString(R.string.action_open_as, "")
}
}