Fix navigation for creating a new pin if forgotten or skipped during registration

Co-authored-by: henry <henry.ph2@gmail.com>

Closes #12183
This commit is contained in:
clauz9
2022-04-23 02:10:01 +03:00
committed by Alex Hart
parent 12d1254d4e
commit d3d9b95924
6 changed files with 22 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ public final class KbsValues extends SignalStoreValues {
private static final String LOCK_LOCAL_PIN_HASH = "kbs.registration_lock_local_pin_hash";
private static final String LAST_CREATE_FAILED_TIMESTAMP = "kbs.last_create_failed_timestamp";
public static final String OPTED_OUT = "kbs.opted_out";
private static final String PIN_FORGOTTEN_OR_SKIPPED = "kbs.pin.forgotten.or.skipped";
KbsValues(KeyValueStore store) {
super(store);
@@ -156,6 +157,14 @@ public final class KbsValues extends SignalStoreValues {
return getLocalPinHash() != null;
}
public synchronized boolean isPinForgottenOrSkipped() {
return getBoolean(PIN_FORGOTTEN_OR_SKIPPED, false);
}
public synchronized void setPinForgottenOrSkipped(boolean value) {
putBoolean(PIN_FORGOTTEN_OR_SKIPPED, value);
}
/** Should only be called by {@link org.thoughtcrime.securesms.pin.PinState}. */
public synchronized void optOut() {
getStore().beginWrite()