diff --git a/src/renderer/index.js b/src/renderer/index.js index 6e32fc108..44637121a 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -16,7 +16,7 @@ import { doAutoUpdate, } from 'redux/actions/app'; import { doNavigate } from 'redux/actions/navigation'; -import { doDownloadLanguages } from 'redux/actions/settings'; +import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings'; import { doUserEmailVerify } from 'redux/actions/user'; import 'scss/all.scss'; import store from 'store'; @@ -26,11 +26,6 @@ const { autoUpdater } = remote.require('electron-updater'); autoUpdater.logger = remote.require('electron-log'); -// window.addEventListener('contextmenu', event => { -// contextMenu(remote.getCurrentWindow(), event.x, event.y, app.env === 'development'); -// event.preventDefault(); -// }); - ipcRenderer.on('open-uri-requested', (event, uri, newSession) => { if (uri && uri.startsWith('lbry://')) { if (uri.startsWith('lbry://?verify=')) { diff --git a/src/renderer/redux/actions/settings.js b/src/renderer/redux/actions/settings.js index 661ff10ba..556bc6b70 100644 --- a/src/renderer/redux/actions/settings.js +++ b/src/renderer/redux/actions/settings.js @@ -2,7 +2,6 @@ import * as ACTIONS from 'constants/action_types'; import * as SETTINGS from 'constants/settings'; import Fs from 'fs'; import Http from 'http'; - import Lbry from 'lbry'; import moment from 'moment'; @@ -54,6 +53,20 @@ export function doGetThemes() { }; } +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)); + })(), + }, + }; +} + export function doUpdateIsNightAsync() { return dispatch => { dispatch(doUpdateIsNight()); @@ -64,19 +77,6 @@ export function doUpdateIsNightAsync() { }; } -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)); - })() - }, - }; -} - export function doDownloadLanguage(langFile) { return dispatch => { const destinationPath = `${app.i18n.directory}/${langFile}`;