Skip to content

Commit 8e8ba23

Browse files
greyson-signalcody-signal
authored andcommitted
Do not show the QR code shortuct if you have no username.
1 parent 54a1b97 commit 8e8ba23

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

app/src/main/java/org/thoughtcrime/securesms/components/settings/app/AppSettingsFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import androidx.navigation.fragment.findNavController
1010
import org.greenrobot.eventbus.EventBus
1111
import org.greenrobot.eventbus.Subscribe
1212
import org.greenrobot.eventbus.ThreadMode
13+
import org.signal.core.util.isNotNullOrBlank
1314
import org.thoughtcrime.securesms.R
1415
import org.thoughtcrime.securesms.badges.BadgeImageView
1516
import org.thoughtcrime.securesms.components.AvatarImageView
@@ -363,7 +364,7 @@ class AppSettingsFragment : DSLSettingsFragment(
363364
summaryView.visibility = View.VISIBLE
364365
avatarView.visibility = View.VISIBLE
365366

366-
if (SignalStore.account().usernameSyncState == AccountValues.UsernameSyncState.IN_SYNC) {
367+
if (SignalStore.account().username.isNotNullOrBlank()) {
367368
qrButton.visibility = View.VISIBLE
368369
qrButton.isClickable = true
369370
qrButton.setOnClickListener { model.onQrButtonClicked() }

core-util/src/main/java/org/signal/core/util/StringExtensions.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ fun String?.nullIfBlank(): String? {
5454
null
5555
}
5656
}
57+
58+
fun CharSequence?.isNotNullOrBlank(): Boolean {
59+
return !this.isNullOrBlank()
60+
}

0 commit comments

Comments
 (0)