mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Feat: Settings Panel
This commit is contained in:
16
main.js
16
main.js
@@ -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() : "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user