-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable reset all and skip options #7721
Changes from 3 commits
329a997
976cc48
2f30718
d2966fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -410,7 +410,7 @@ | |
<string name="action_disconnect">Disconnect</string> | ||
<string name="action_play">Play</string> | ||
<string name="action_dismiss">Dismiss</string> | ||
<string name="action_reset">Reset</string> | ||
<string name="action_reset">Proceed to Reset</string> | ||
<string name="action_learn_more">Learn more</string> | ||
<string name="action_next">Next</string> | ||
<string name="action_got_it">Got it</string> | ||
|
@@ -2634,9 +2634,10 @@ | |
<string name="failed_to_access_secure_storage">Failed to access secure storage</string> | ||
<string name="bad_passphrase_key_reset_all_action">Forgot or lost all recovery options? Reset everything</string> | ||
<string name="secure_backup_reset_all">Reset everything</string> | ||
<string name="secure_backup_reset_all_no_other_devices">Only do this if you have no other device you can verify this device with.</string> | ||
<string name="secure_backup_reset_all_no_other_devices">Resetting your verification keys cannot be undone. After resetting, you won't have access to old encrypted messages, and any friends who have previously verified you will see security warnings until you re-verify with them.</string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. create a new string here? and mark this one as eventually? Check the Contributing.md for strings. I think we can keep a short version and a longer one. Use the short in the bottomsheet and the long in the reset fragment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
<string name="secure_backup_reset_if_you_reset_all">If you reset everything</string> | ||
<string name="secure_backup_reset_no_history">You will restart with no history, no messages, trusted devices or trusted users</string> | ||
<string name="secure_backup_reset_danger_warning">Please only proceed if you\'re sure you\'ve lost all of your other devices and your security key.</string> | ||
<plurals name="secure_backup_reset_devices_you_can_verify"> | ||
<item quantity="one">Show the device you can verify with now</item> | ||
<item quantity="other">Show %d devices you can verify with now</item> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ data class SharedSecureStorageViewState( | |
val ready: Boolean = false, | ||
val hasPassphrase: Boolean = true, | ||
val checkingSSSSAction: Async<Unit> = Uninitialized, | ||
val step: Step = Step.EnterPassphrase, | ||
val step: Step = Step.ResetAll, | ||
val activeDeviceCount: Int = 0, | ||
val showResetAllAction: Boolean = false, | ||
val userId: String = "", | ||
|
@@ -74,7 +74,8 @@ data class SharedSecureStorageViewState( | |
} else { | ||
RequestType.ReadSecrets(args.requestedSecrets) | ||
}, | ||
resultKeyStoreAlias = args.resultKeyStoreAlias | ||
resultKeyStoreAlias = args.resultKeyStoreAlias, | ||
step = args.currentStep, | ||
) | ||
|
||
enum class Step { | ||
|
@@ -125,15 +126,17 @@ class SharedSecureStorageViewModel @AssistedInject constructor( | |
copy( | ||
hasPassphrase = true, | ||
ready = true, | ||
step = SharedSecureStorageViewState.Step.EnterPassphrase | ||
step = if (initialState.step == SharedSecureStorageViewState.Step.ResetAll) SharedSecureStorageViewState.Step.ResetAll | ||
else SharedSecureStorageViewState.Step.EnterPassphrase | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find this a bit strange. |
||
) | ||
} | ||
} else { | ||
setState { | ||
copy( | ||
hasPassphrase = false, | ||
ready = true, | ||
step = SharedSecureStorageViewState.Step.EnterKey | ||
step = if (initialState.step == SharedSecureStorageViewState.Step.ResetAll) SharedSecureStorageViewState.Step.ResetAll | ||
else SharedSecureStorageViewState.Step.EnterKey | ||
) | ||
} | ||
} | ||
|
@@ -203,6 +206,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor( | |
_viewEvents.post(SharedSecureStorageViewEvent.Dismiss) | ||
} | ||
} | ||
/* | ||
SharedSecureStorageViewState.Step.ResetAll -> { | ||
setState { | ||
copy( | ||
|
@@ -211,6 +215,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor( | |
) | ||
} | ||
} | ||
*/ | ||
amitkma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else -> { | ||
_viewEvents.post(SharedSecureStorageViewEvent.Dismiss) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,19 +60,6 @@ | |
tools:text="Show 2 devices you can verify with now" | ||
tools:visibility="visible" /> | ||
|
||
<TextView | ||
android:id="@+id/ssss_reset_text3" | ||
style="@style/Widget.Vector.TextView.Subtitle" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="16dp" | ||
android:text="@string/secure_backup_reset_if_you_reset_all" | ||
android:textColor="?colorError" | ||
android:textStyle="bold" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/ssss_reset_other_devices" /> | ||
|
||
<TextView | ||
android:id="@+id/ssss_reset_text4" | ||
style="@style/Widget.Vector.TextView.Body" | ||
|
@@ -82,9 +69,10 @@ | |
android:layout_marginTop="16dp" | ||
android:layout_marginEnd="16dp" | ||
android:layout_marginBottom="16dp" | ||
android:text="@string/secure_backup_reset_no_history" | ||
android:text="@string/secure_backup_reset_danger_warning" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's for consistency with web? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
android:textColor="?vctr_content_primary" | ||
app:layout_constraintTop_toBottomOf="@id/ssss_reset_text3" /> | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/ssss_reset_other_devices" /> | ||
|
||
<Button | ||
android:id="@+id/ssss_reset_button_cancel" | ||
|
@@ -118,4 +106,4 @@ | |
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</ScrollView> | ||
</ScrollView> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather create a new string, this one might be used somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already checked that it is not used anywhere other than reset fragment. I will add a new string as per contribution guidelines.