fix: handle profile page after step 9 phone verify
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
addLog,
|
||||
ensureStep8SignupPageReady,
|
||||
fetchImpl = (...args) => fetch(...args),
|
||||
generateRandomBirthday,
|
||||
generateRandomName,
|
||||
getOAuthFlowStepTimeoutMs,
|
||||
getState,
|
||||
sendToContentScript,
|
||||
@@ -3295,13 +3297,35 @@
|
||||
}
|
||||
|
||||
async function submitPhoneVerificationCode(tabId, code) {
|
||||
const signupProfile = (
|
||||
typeof generateRandomName === 'function'
|
||||
&& typeof generateRandomBirthday === 'function'
|
||||
)
|
||||
? (() => {
|
||||
const name = generateRandomName();
|
||||
const birthday = generateRandomBirthday();
|
||||
if (!name?.firstName || !name?.lastName || !birthday) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
firstName: name.firstName,
|
||||
lastName: name.lastName,
|
||||
year: birthday.year,
|
||||
month: birthday.month,
|
||||
day: birthday.day,
|
||||
};
|
||||
})()
|
||||
: null;
|
||||
const timeoutMs = typeof getOAuthFlowStepTimeoutMs === 'function'
|
||||
? await getOAuthFlowStepTimeoutMs(45000, { step: 9, actionLabel: 'submit phone verification code' })
|
||||
: 45000;
|
||||
const result = await sendToContentScriptResilient('signup-page', {
|
||||
type: 'SUBMIT_PHONE_VERIFICATION_CODE',
|
||||
source: 'background',
|
||||
payload: { code },
|
||||
payload: {
|
||||
code,
|
||||
...(signupProfile ? { signupProfile } : {}),
|
||||
},
|
||||
}, {
|
||||
timeoutMs,
|
||||
responseTimeoutMs: timeoutMs,
|
||||
|
||||
Reference in New Issue
Block a user