update ktlint plugin to 11.3.1, format code (#3442)
This commit is contained in:
parent
774d79d666
commit
d839f18267
141 changed files with 589 additions and 428 deletions
|
|
@ -66,7 +66,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
|
|||
oauthScopes: String,
|
||||
newAccount: Account
|
||||
) {
|
||||
|
||||
activeAccount?.let {
|
||||
it.isActive = false
|
||||
Log.d(TAG, "addAccount: saving account with id " + it.id)
|
||||
|
|
@ -121,7 +120,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
|
|||
* @return the new active account, or null if no other account was found
|
||||
*/
|
||||
fun logActiveAccountOut(): AccountEntity? {
|
||||
|
||||
return activeAccount?.let { account ->
|
||||
|
||||
account.logout()
|
||||
|
|
@ -167,7 +165,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
|
|||
* @param accountId the database id of the new active account
|
||||
*/
|
||||
fun setActiveAccount(accountId: Long) {
|
||||
|
||||
val newActiveAccount = accounts.find { (id) ->
|
||||
id == accountId
|
||||
} ?: return // invalid accountId passed, do nothing
|
||||
|
|
@ -237,10 +234,12 @@ class AccountManager @Inject constructor(db: AppDatabase) {
|
|||
fun shouldDisplaySelfUsername(context: Context): Boolean {
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val showUsernamePreference = sharedPreferences.getString(PrefKeys.SHOW_SELF_USERNAME, "disambiguate")
|
||||
if (showUsernamePreference == "always")
|
||||
if (showUsernamePreference == "always") {
|
||||
return true
|
||||
if (showUsernamePreference == "never")
|
||||
}
|
||||
if (showUsernamePreference == "never") {
|
||||
return false
|
||||
}
|
||||
|
||||
return accounts.size > 1 // "disambiguate"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue