mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 17:26:17 +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 time24Val = typeof srec['time24'] === 'string' ? String(srec['time24']) : undefined
|
||||
|
||||
if (useAmPmVal === true) {
|
||||
if (useAmPmVal) {
|
||||
formatName = '12h'
|
||||
timeShown = time12Val || sched.time || '9:00 AM'
|
||||
} else if (useAmPmVal === false) {
|
||||
|
||||
@@ -359,6 +359,7 @@ export function loadConfig(): Config {
|
||||
candidates.push(path.join(base, name))
|
||||
}
|
||||
}
|
||||
|
||||
let cfgPath: string | null = null
|
||||
for (const p of candidates) {
|
||||
try { if (fs.existsSync(p)) { cfgPath = p; break } } catch { /* ignore */ }
|
||||
@@ -368,7 +369,7 @@ export function loadConfig(): Config {
|
||||
const text = config.replace(/^\uFEFF/, '')
|
||||
const raw = JSON.parse(stripJsonComments(text))
|
||||
const normalized = normalizeConfig(raw)
|
||||
configCache = normalized // Set as cache
|
||||
configCache = normalized
|
||||
configSourcePath = cfgPath
|
||||
|
||||
return normalized
|
||||
|
||||
@@ -42,6 +42,7 @@ export class Retry {
|
||||
let attempt = 0
|
||||
let delay = this.policy.baseDelay
|
||||
let lastErr: unknown
|
||||
|
||||
while (attempt < this.policy.maxAttempts) {
|
||||
try {
|
||||
return await fn()
|
||||
|
||||
Reference in New Issue
Block a user