chore: move unlockAllSimarisResearchEntries to a per-account button #2726

Merged
Sainan merged 2 commits from config-stuff into main 2025-08-30 19:34:55 -07:00
2 changed files with 15 additions and 10 deletions
Showing only changes of commit 8d527af2e9 - Show all commits

View File

@ -4,7 +4,7 @@ import { repoDir } from "../helpers/pathHelper.ts";
import { args } from "../helpers/commandLineArguments.ts";
import { Inbox } from "../models/inboxModel.ts";
export interface IConfig extends IConfigRemovedOptions {
export interface IConfig {
mongodbUrl: string;
logger: {
files: boolean;
@ -123,11 +123,7 @@ export const configRemovedOptionsKeys = [
"flawlessRelicsAlwaysGiveSilverReward",
"radiantRelicsAlwaysGiveGoldReward",
"disableDailyTribute"
] as const;
type IConfigRemovedOptions = {
[K in (typeof configRemovedOptionsKeys)[number]]?: boolean;
};
];
export const configPath = path.join(repoDir, args.configPath ?? "config.json");

View File

@ -1,6 +1,13 @@
import chokidar from "chokidar";
import { logger } from "../utils/logger.ts";
import { config, configPath, configRemovedOptionsKeys, loadConfig, syncConfigWithDatabase } from "./configService.ts";
import {
config,
configPath,
configRemovedOptionsKeys,
loadConfig,
syncConfigWithDatabase,
type IConfig
} from "./configService.ts";
import { saveConfig, shouldReloadConfig } from "./configWriterService.ts";
import { getWebPorts, startWebServer, stopWebServer } from "./webService.ts";
import { sendWsBroadcast } from "./wsService.ts";
@ -35,9 +42,11 @@ chokidar.watch(configPath).on("change", () => {
export const validateConfig = (): void => {
let modified = false;
for (const key of configRemovedOptionsKeys) {
if (config[key] !== undefined) {
logger.debug(`Spotted removed option ${key} with value ${config[key]} in config.json.`);
delete config[key];
if (config[key as keyof IConfig] !== undefined) {
logger.debug(
`Spotted removed option ${key} with value ${String(config[key as keyof IConfig])} in config.json.`
);
delete config[key as keyof IConfig];
modified = true;
}
}