Преглед изворни кода

feat: 增加最大轮次常量以优化验证码轮询逻辑

QLHazyCoder пре 4 месеци
родитељ
комит
51f2e7fd8e
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      background.js

+ 2 - 1
background.js

@@ -1225,6 +1225,7 @@ let autoRunActive = false;
 let autoRunCurrentRun = 0;
 let autoRunTotalRuns = 1;
 let autoRunAttemptRun = 0;
+const VERIFICATION_POLL_MAX_ROUNDS = 9;
 const AUTO_STEP_DELAYS = {
   1: 2000,
   2: 2000,
@@ -1744,7 +1745,7 @@ async function pollFreshVerificationCode(step, state, mail, pollOverrides = {})
 
   let lastError = null;
   let filterAfterTimestamp = pollOverrides.filterAfterTimestamp ?? getVerificationPollPayload(step, state).filterAfterTimestamp;
-  const maxRounds = pollOverrides.maxRounds || 3;
+  const maxRounds = pollOverrides.maxRounds || VERIFICATION_POLL_MAX_ROUNDS;
 
   for (let round = 1; round <= maxRounds; round++) {
     if (round > 1) {