Bug 1823776 - Handle SHOW_MIGRATION_WIZARD inside nested MULTI_ACTION r=pdahiya,omc-reviewers,aminomancer

Differential Revision: https://phabricator.services.mozilla.com/D173558
This commit is contained in:
Emily McMinn
2023-03-31 21:19:50 +00:00
parent 14c58ffcbf
commit e47831b644
3 changed files with 93 additions and 10 deletions

View File

@@ -348,13 +348,10 @@ export class WelcomeScreen extends React.PureComponent {
} else if (action.type) {
AboutWelcomeUtils.handleUserAction(action);
// Wait until migration closes to complete the action
if (
action.type === "SHOW_MIGRATION_WIZARD" ||
(action.type === "MULTI_ACTION" &&
action?.data?.actions.find(
subAction => subAction.type === "SHOW_MIGRATION_WIZARD"
))
) {
const hasMigrate = a =>
a.type === "SHOW_MIGRATION_WIZARD" ||
(a.type === "MULTI_ACTION" && a.data?.actions?.some(hasMigrate));
if (hasMigrate(action)) {
await window.AWWaitForMigrationClose();
AboutWelcomeUtils.sendActionTelemetry(props.messageId, "migrate_close");
}