From cb61f8835776fbce8577efc90a52a03cc9524412 Mon Sep 17 00:00:00 2001 From: Quentin Decaunes Date: Fri, 1 Mar 2019 17:28:08 +0100 Subject: [PATCH] Fixed default settings for reapply periodically. --- js/methods.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/methods.js b/js/methods.js index 09afeb6..7f6d6d6 100644 --- a/js/methods.js +++ b/js/methods.js @@ -116,10 +116,13 @@ function preFillSettings() { notification('danger', "Path to ryzenadj.exe is wrong, please fix it in settings tab."); } const settings = require('electron-settings'); - document.getElementById('apply_last_settings_on_launch').checked = settings.get('settings.apply_last_settings_on_launch'); - document.getElementById('minimize_to_tray').checked = settings.get('settings.minimize_to_tray'); - document.getElementById('reapply_periodically').value = settings.get('settings.reapply_periodically'); - document.getElementById('reapply_periodically_range').value = settings.get('settings.reapply_periodically'); + document.getElementById('apply_last_settings_on_launch').checked = !!settings.get('settings.apply_last_settings_on_launch'); + document.getElementById('minimize_to_tray').checked = !!settings.get('settings.minimize_to_tray'); + + seconds = parseInt(settings.get('settings.reapply_periodically')); + seconds = seconds >= 0 ? seconds : 0; + document.getElementById('reapply_periodically').value = seconds; + document.getElementById('reapply_periodically_range').value = seconds; } /**