Inline the username flag.

This commit is contained in:
Greyson Parrelli
2024-02-06 10:34:40 -05:00
committed by Cody Henthorne
parent bd3b779282
commit 8ad77ac7aa
11 changed files with 14 additions and 51 deletions

View File

@@ -4,7 +4,6 @@ import android.content.Context
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.keyvalue.AccountValues.UsernameSyncState
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.util.FeatureFlags
/**
* Displays a reminder message when the local username gets out of sync with
@@ -42,14 +41,10 @@ class UsernameOutOfSyncReminder : Reminder(NO_RESOURCE) {
companion object {
@JvmStatic
fun isEligible(): Boolean {
return if (FeatureFlags.usernames()) {
when (SignalStore.account().usernameSyncState) {
UsernameSyncState.USERNAME_AND_LINK_CORRUPTED -> true
UsernameSyncState.LINK_CORRUPTED -> true
UsernameSyncState.IN_SYNC -> false
}
} else {
false
return when (SignalStore.account().usernameSyncState) {
UsernameSyncState.USERNAME_AND_LINK_CORRUPTED -> true
UsernameSyncState.LINK_CORRUPTED -> true
UsernameSyncState.IN_SYNC -> false
}
}
}

View File

@@ -363,7 +363,7 @@ class AppSettingsFragment : DSLSettingsFragment(
summaryView.visibility = View.VISIBLE
avatarView.visibility = View.VISIBLE
if (FeatureFlags.usernames() && SignalStore.account().usernameSyncState == AccountValues.UsernameSyncState.IN_SYNC) {
if (SignalStore.account().usernameSyncState == AccountValues.UsernameSyncState.IN_SYNC) {
qrButton.visibility = View.VISIBLE
qrButton.isClickable = true
qrButton.setOnClickListener { model.onQrButtonClicked() }