Feat: Settings Panel

This commit is contained in:
MasterAcnolo
2026-01-20 22:28:53 +01:00
parent fef4f6de36
commit 343dbb26a2
8 changed files with 460 additions and 36 deletions

16
main.js
View File

@@ -204,6 +204,22 @@ app.whenReady().then(async () => {
ipcMain.handle("features", () => {
return configFeatures;
});
ipcMain.handle("set-feature", (event, { key, value }) => {
try {
// update mémoire
configFeatures[key] = value;
// écriture directe sur le JSON
fs.writeFileSync(configFolderPath, JSON.stringify(configFeatures, null, 2), "utf-8");
logger.info(`Feature updated: ${key} = ${value}`);
return true;
} catch (err) {
logger.error(`set-feature failed (${key}): ${err.message}`);
return false;
}
});
configFeatures.discordRPC ? startRPC() : "";