diff --git a/src/renderer/redux/actions/settings.js b/src/renderer/redux/actions/settings.js index 9397efada..661ff10ba 100644 --- a/src/renderer/redux/actions/settings.js +++ b/src/renderer/redux/actions/settings.js @@ -68,11 +68,11 @@ export function doUpdateIsNight() { const momentNow = moment(); return { type: ACTIONS.UPDATE_IS_NIGHT, - data: { isNight: () => { - const startNightMoment = moment('19:00', 'HH:mm'); - const endNightMoment = moment('8:00', 'HH:mm'); - return !(momentNow.isAfter(endNightMoment) && momentNow.isBefore(startNightMoment)); - } + data: { isNight: (() => { + const startNightMoment = moment('19:00', 'HH:mm'); + const endNightMoment = moment('8:00', 'HH:mm'); + return !(momentNow.isAfter(endNightMoment) && momentNow.isBefore(startNightMoment)); + })() }, }; }