Skip to content

Commit f560d85

Browse files
committed
Feature done: Clear Background Image
1 parent 8e4aee2 commit f560d85

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,15 @@ ipcMain.on('req-version', (event) => {
106106
});
107107

108108
ipcMain.on('clear-background', (event) => {
109-
console.log('Event: Clear Background Image');
109+
const rawConfig = fs.readFileSync(userConfigPath, { encoding: 'utf-8' });
110+
const config = JSON.parse(rawConfig);
111+
112+
const newConfig = {
113+
...config,
114+
background: ''
115+
}
116+
fs.writeFileSync(userConfigPath, JSON.stringify(newConfig, null, 4), { encoding: 'utf-8' });
117+
backgroundSelect.close();
118+
main.webContents.send('update-background', '');
119+
main.loadFile(path.join(publicPath, 'index.html'));
110120
});

0 commit comments

Comments
 (0)