Fix phone verification restart after add-phone fallback

This commit is contained in:
sh2001sh
2026-04-22 22:58:28 +08:00
parent e7af5c5c4a
commit 48cf6847c7
2 changed files with 141 additions and 1 deletions
+16 -1
View File
@@ -691,7 +691,22 @@
await addLog(`Step 9: received phone verification code ${codeResult.code}.`, 'info');
const submitResult = await submitPhoneVerificationCode(tabId, codeResult.code);
if (submitResult.invalidCode || submitResult.returnedToAddPhone) {
if (submitResult.returnedToAddPhone) {
await addLog(
'Step 9: phone verification returned to add-phone after code submission, replacing the current number.',
'warn'
);
shouldReplaceNumber = true;
pageState = {
...pageState,
...submitResult,
addPhonePage: true,
phoneVerificationPage: false,
};
break;
}
if (submitResult.invalidCode) {
if (attempt >= DEFAULT_PHONE_SUBMIT_ATTEMPTS) {
throw new Error(
`Phone verification code was rejected after ${DEFAULT_PHONE_SUBMIT_ATTEMPTS} attempts: ${submitResult.errorText || submitResult.url || 'unknown error'}`