Skip to content

Commit

Permalink
preference: Only toggle the state if element is present.
Browse files Browse the repository at this point in the history
Fixes #393.
  • Loading branch information
priyank-p authored and akashnimare committed Jan 22, 2018
1 parent c8d7a79 commit aedd952
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/renderer/js/pages/preference/preference.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ class PreferenceView extends BaseComponent {
ipcRenderer.on('toggle-sidebar', (event, state) => {
const inputSelector = '#sidebar-option .action .switch input';
const input = document.querySelector(inputSelector);
input.checked = state;
if (input) {
input.checked = state;
}
});

ipcRenderer.on('toggletray', (event, state) => {
const inputSelector = '#tray-option .action .switch input';
const input = document.querySelector(inputSelector);
input.checked = state;
if (input) {
input.checked = state;
}
});
}
}
Expand Down

0 comments on commit aedd952

Please sign in to comment.