Fix #30439: "Forgot recovery key" should go to "reset" (#30771)

* Fix #30439: "Forgot recovery key" should go to "reset"

* Wrap showToast in act() to ensure React render is finished

* Remove duplicated code
This commit is contained in:
Andy Balaam
2025-09-16 14:29:45 +01:00
committed by GitHub
parent 81fc054b8b
commit c9f375a02b
2 changed files with 16 additions and 25 deletions

View File

@@ -197,7 +197,8 @@ export const showToast = (kind: Kind): void => {
deviceListener.dismissEncryptionSetup();
break;
}
case Kind.KEY_STORAGE_OUT_OF_SYNC: {
case Kind.KEY_STORAGE_OUT_OF_SYNC:
case Kind.KEY_STORAGE_OUT_OF_SYNC_STORE: {
// Open the user settings dialog to the encryption tab and start the flow to reset encryption
const payload: OpenToTabPayload = {
action: Action.ViewUserSettings,
@@ -207,16 +208,6 @@ export const showToast = (kind: Kind): void => {
defaultDispatcher.dispatch(payload);
break;
}
case Kind.KEY_STORAGE_OUT_OF_SYNC_STORE: {
// Open the user settings dialog to the encryption tab and start the flow to reset 4S
const payload: OpenToTabPayload = {
action: Action.ViewUserSettings,
initialTabId: UserTab.Encryption,
props: { initialEncryptionState: "change_recovery_key" },
};
defaultDispatcher.dispatch(payload);
break;
}
case Kind.TURN_ON_KEY_STORAGE: {
// The user clicked "Dismiss": offer them "Are you sure?"
const modal = Modal.createDialog(