mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-29 16:31:02 +00:00
Refactor: Remove legacy code and improve import statements across multiple files
This commit is contained in:
@@ -3,9 +3,8 @@ import { BrowserFingerprintWithHeaders } from 'fingerprint-generator'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
|
||||
import { Account } from '../interface/Account'
|
||||
import { Config, ConfigLegacyFlags, ConfigSaveFingerprint } from '../interface/Config'
|
||||
import { Config, ConfigSaveFingerprint } from '../interface/Config'
|
||||
|
||||
let configCache: Config
|
||||
let configSourcePath = ''
|
||||
@@ -188,15 +187,6 @@ function normalizeConfig(raw: unknown): Config {
|
||||
skipCompletedAccounts: jobStateRaw.skipCompletedAccounts !== false
|
||||
}
|
||||
|
||||
const legacy: ConfigLegacyFlags = {}
|
||||
if (typeof n.diagnostics !== 'undefined') {
|
||||
legacy.diagnosticsConfigured = true
|
||||
}
|
||||
if (typeof n.analytics !== 'undefined') {
|
||||
legacy.analyticsConfigured = true
|
||||
}
|
||||
const hasLegacyFlags = legacy.diagnosticsConfigured === true || legacy.analyticsConfigured === true
|
||||
|
||||
const cfg: Config = {
|
||||
baseURL: n.baseURL ?? 'https://rewards.bing.com',
|
||||
sessionPath: n.sessionPath ?? 'sessions',
|
||||
@@ -226,8 +216,7 @@ function normalizeConfig(raw: unknown): Config {
|
||||
crashRecovery: n.crashRecovery || {},
|
||||
riskManagement,
|
||||
dryRun,
|
||||
queryDiversity,
|
||||
legacy: hasLegacyFlags ? legacy : undefined
|
||||
queryDiversity
|
||||
}
|
||||
|
||||
return cfg
|
||||
|
||||
Reference in New Issue
Block a user