mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 18:13:28 +07:00
Automagically reset ryzenadj path to the one included.
This commit is contained in:
parent
80aa9a9108
commit
309a02b129
11
main.js
11
main.js
@ -7,6 +7,16 @@ if (setupEvents.handleSquirrelEvent()) {
|
||||
|
||||
// Modules to control application life and create native browser window
|
||||
const {app, BrowserWindow, Menu, Tray} = require('electron')
|
||||
const settings = require('electron-settings');
|
||||
|
||||
// Check for latest used version and clear settings if needed.
|
||||
if (settings.get('settings.last_used_version') !== require('./package.json').version) {
|
||||
settings.delete('settings.ryzen_adj_path');
|
||||
settings.set('settings', {
|
||||
...settings.set('settings'),
|
||||
last_used_version: require('./package.json').version
|
||||
});
|
||||
}
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
@ -39,7 +49,6 @@ function createWindow () {
|
||||
mainWindow = null
|
||||
})
|
||||
|
||||
const settings = require('electron-settings');
|
||||
mainWindow.on('minimize',function(event){
|
||||
if (settings.get('settings.minimize_to_tray')) {
|
||||
event.preventDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user