diff --git a/src/main/announcement.js b/src/main/announcement.js index ca4ab019..6ef429b1 100644 --- a/src/main/announcement.js +++ b/src/main/announcement.js @@ -50,7 +50,5 @@ function onResponse (err, res, data) { title: data.title, message: data.message, detail: data.detail - }, noop) + }) } - -function noop () {} diff --git a/src/main/menu.js b/src/main/menu.js index c93a234f..37f34551 100644 --- a/src/main/menu.js +++ b/src/main/menu.js @@ -357,8 +357,7 @@ function getMenuTemplate () { type: 'separator' }, { - role: 'services', - submenu: [] + role: 'services' }, { type: 'separator' diff --git a/src/main/updater.js b/src/main/updater.js index b6d60966..f54d8599 100644 --- a/src/main/updater.js +++ b/src/main/updater.js @@ -72,6 +72,6 @@ function initDarwinWin32 () { (e, notes, name, date, url) => log(`Update downloaded: ${name}: ${url}`) ) - electron.autoUpdater.setFeedURL(AUTO_UPDATE_URL) + electron.autoUpdater.setFeedURL({ url: AUTO_UPDATE_URL }) electron.autoUpdater.checkForUpdates() } diff --git a/src/main/windows/main.js b/src/main/windows/main.js index dbfb7d0c..360f1072 100644 --- a/src/main/windows/main.js +++ b/src/main/windows/main.js @@ -32,7 +32,6 @@ function init (state, options) { const win = main.win = new electron.BrowserWindow({ backgroundColor: '#282828', - backgroundThrottling: false, // do not throttle animations/timers when page is background darkTheme: true, // Forces dark theme (GTK+3) height: initialBounds.height, icon: getIconPath(), // Window icon (Windows, Linux) diff --git a/src/main/windows/webtorrent.js b/src/main/windows/webtorrent.js index 8c58043b..97185a7d 100644 --- a/src/main/windows/webtorrent.js +++ b/src/main/windows/webtorrent.js @@ -13,7 +13,6 @@ const config = require('../../config') function init () { const win = webtorrent.win = new electron.BrowserWindow({ backgroundColor: '#1E1E1E', - backgroundThrottling: false, // do not throttle animations/timers when page is background center: true, fullscreen: false, fullscreenable: false, diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index e32cfcbc..b723cf4d 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -279,7 +279,7 @@ module.exports = class TorrentListController { enabled: torrentSummary.torrentFileName != null })) - menu.popup(electron.remote.getCurrentWindow()) + menu.popup({ window: electron.remote.getCurrentWindow() }) } // Takes a torrentSummary or torrentKey @@ -323,7 +323,7 @@ function findFilesRecursive (paths, cb_) { findFilesRecursive([path], function (fileObjs) { ret.push(...fileObjs) if (++numComplete === paths.length) { - ret.sort((a, b) => a.path < b.path ? -1 : a.path > b.path) + ret.sort((a, b) => a.path < b.path ? -1 : Number(a.path > b.path)) cb_(ret) } }) diff --git a/src/renderer/lib/torrent-poster.js b/src/renderer/lib/torrent-poster.js index a961a3cc..13eefadc 100644 --- a/src/renderer/lib/torrent-poster.js +++ b/src/renderer/lib/torrent-poster.js @@ -74,7 +74,7 @@ function getLargestFileByExtension (torrent, extensions) { * Filter file on a list extension, can be used to find al image files * @param torrent Torrent to filter files from * @param extensions File extensions to filter on - * @returns {number} Array of torrent file objects matching one of the given extensions + * @returns {Array} Array of torrent file objects matching one of the given extensions */ function filterOnExtension (torrent, extensions) { return torrent.files.filter(file => { diff --git a/src/renderer/main.js b/src/renderer/main.js index 7864ca5f..1412c25a 100644 --- a/src/renderer/main.js +++ b/src/renderer/main.js @@ -551,7 +551,7 @@ function onBlur () { } function onVisibilityChange () { - state.window.isVisible = !document.webkitHidden + state.window.isVisible = !document.hidden } function onFullscreenChanged (e, isFullScreen) { diff --git a/src/renderer/pages/player-page.js b/src/renderer/pages/player-page.js index 43f610d6..d626a012 100644 --- a/src/renderer/pages/player-page.js +++ b/src/renderer/pages/player-page.js @@ -109,9 +109,9 @@ function renderMedia (state) { trackTags.push( ) @@ -497,7 +497,7 @@ function renderPlayerControls (state) {