Skip to content

Commit

Permalink
Disable registration lock toggle and pin reminder toggle if user does…
Browse files Browse the repository at this point in the history
… not have a pin.
  • Loading branch information
alex-signal authored and greyson-signal committed Aug 2, 2021
1 parent 52978b1 commit 3b8eac0
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -43,6 +43,11 @@ class AccountSettingsFragment : DSLSettingsFragment(R.string.AccountSettingsFrag
}
}

override fun onResume() {
super.onResume()
viewModel.refreshState()
}

override fun bindAdapter(adapter: DSLSettingsAdapter) {
viewModel = ViewModelProviders.of(this)[AccountSettingsViewModel::class.java]

Expand Down Expand Up @@ -70,7 +75,8 @@ class AccountSettingsFragment : DSLSettingsFragment(R.string.AccountSettingsFrag
switchPref(
title = DSLSettingsText.from(R.string.preferences_app_protection__pin_reminders),
summary = DSLSettingsText.from(R.string.AccountSettingsFragment__youll_be_asked_less_frequently),
isChecked = state.pinRemindersEnabled,
isChecked = state.hasPin && state.pinRemindersEnabled,
isEnabled = state.hasPin,
onClick = {
setPinRemindersEnabled(!state.pinRemindersEnabled)
}
Expand All @@ -80,6 +86,7 @@ class AccountSettingsFragment : DSLSettingsFragment(R.string.AccountSettingsFrag
title = DSLSettingsText.from(R.string.preferences_app_protection__registration_lock),
summary = DSLSettingsText.from(R.string.AccountSettingsFragment__require_your_signal_pin),
isChecked = state.registrationLockEnabled,
isEnabled = state.hasPin,
onClick = {
setRegistrationLockEnabled(!state.registrationLockEnabled)
}
Expand Down

0 comments on commit 3b8eac0

Please sign in to comment.