mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-11 09:46:16 +00:00
Corrige l'indentation et améliore la lisibilité du code dans plusieurs fichiers
This commit is contained in:
@@ -459,7 +459,7 @@ export class MicrosoftRewardsBot {
|
|||||||
const time12Val = typeof srec['time12'] === 'string' ? String(srec['time12']) : undefined
|
const time12Val = typeof srec['time12'] === 'string' ? String(srec['time12']) : undefined
|
||||||
const time24Val = typeof srec['time24'] === 'string' ? String(srec['time24']) : undefined
|
const time24Val = typeof srec['time24'] === 'string' ? String(srec['time24']) : undefined
|
||||||
|
|
||||||
if (useAmPmVal === true) {
|
if (useAmPmVal) {
|
||||||
formatName = '12h'
|
formatName = '12h'
|
||||||
timeShown = time12Val || sched.time || '9:00 AM'
|
timeShown = time12Val || sched.time || '9:00 AM'
|
||||||
} else if (useAmPmVal === false) {
|
} else if (useAmPmVal === false) {
|
||||||
|
|||||||
@@ -359,6 +359,7 @@ export function loadConfig(): Config {
|
|||||||
candidates.push(path.join(base, name))
|
candidates.push(path.join(base, name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cfgPath: string | null = null
|
let cfgPath: string | null = null
|
||||||
for (const p of candidates) {
|
for (const p of candidates) {
|
||||||
try { if (fs.existsSync(p)) { cfgPath = p; break } } catch { /* ignore */ }
|
try { if (fs.existsSync(p)) { cfgPath = p; break } } catch { /* ignore */ }
|
||||||
@@ -368,7 +369,7 @@ export function loadConfig(): Config {
|
|||||||
const text = config.replace(/^\uFEFF/, '')
|
const text = config.replace(/^\uFEFF/, '')
|
||||||
const raw = JSON.parse(stripJsonComments(text))
|
const raw = JSON.parse(stripJsonComments(text))
|
||||||
const normalized = normalizeConfig(raw)
|
const normalized = normalizeConfig(raw)
|
||||||
configCache = normalized // Set as cache
|
configCache = normalized
|
||||||
configSourcePath = cfgPath
|
configSourcePath = cfgPath
|
||||||
|
|
||||||
return normalized
|
return normalized
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export class Retry {
|
|||||||
let attempt = 0
|
let attempt = 0
|
||||||
let delay = this.policy.baseDelay
|
let delay = this.policy.baseDelay
|
||||||
let lastErr: unknown
|
let lastErr: unknown
|
||||||
|
|
||||||
while (attempt < this.policy.maxAttempts) {
|
while (attempt < this.policy.maxAttempts) {
|
||||||
try {
|
try {
|
||||||
return await fn()
|
return await fn()
|
||||||
|
|||||||
Reference in New Issue
Block a user