Skip to content

Commit

Permalink
fix(shared): remove unneeded defensive code (#3)
Browse files Browse the repository at this point in the history
Remove condition that always evaluates to false. `value` can't be null & undefined at the same time

Co-authored-by: Jérôme Boukorras <51956779+itupix@users.noreply.github.com>
  • Loading branch information
hamzahamidi and itupix authored Jun 25, 2020
1 parent 1667ccc commit e10faca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/shared/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ export const pullRequests = writable([]);
const getSettingsByKey = (key, initial, type = undefined) => {
let value = getItem(key);

if (
(typeof value !== 'boolean' && !value && value !== 0) ||
(value === undefined && value === null)
) {
value = initial;
addItem(key, value);
if (typeof value !== 'boolean' && !value && value !== 0) {
value = initial;
addItem(key, value);

if (key === 'startup') {
ipcRenderer.send('launch-startup', value);
Expand Down

0 comments on commit e10faca

Please sign in to comment.