Corrige l'indentation et améliore la lisibilité du code dans plusieurs fichiers

This commit is contained in:
2025-11-03 16:34:25 +01:00
parent 579c8a4dcd
commit 6ebf2afce3
4 changed files with 18 additions and 16 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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()