Merge pull request #1720 from webtorrent/type-issues

Fix a few type errors
This commit is contained in:
Julen Garcia Leunda
2019-10-18 11:26:25 +02:00
committed by GitHub
9 changed files with 10 additions and 15 deletions

View File

@@ -50,7 +50,5 @@ function onResponse (err, res, data) {
title: data.title, title: data.title,
message: data.message, message: data.message,
detail: data.detail detail: data.detail
}, noop) })
} }
function noop () {}

View File

@@ -357,8 +357,7 @@ function getMenuTemplate () {
type: 'separator' type: 'separator'
}, },
{ {
role: 'services', role: 'services'
submenu: []
}, },
{ {
type: 'separator' type: 'separator'

View File

@@ -72,6 +72,6 @@ function initDarwinWin32 () {
(e, notes, name, date, url) => log(`Update downloaded: ${name}: ${url}`) (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() electron.autoUpdater.checkForUpdates()
} }

View File

@@ -32,7 +32,6 @@ function init (state, options) {
const win = main.win = new electron.BrowserWindow({ const win = main.win = new electron.BrowserWindow({
backgroundColor: '#282828', backgroundColor: '#282828',
backgroundThrottling: false, // do not throttle animations/timers when page is background
darkTheme: true, // Forces dark theme (GTK+3) darkTheme: true, // Forces dark theme (GTK+3)
height: initialBounds.height, height: initialBounds.height,
icon: getIconPath(), // Window icon (Windows, Linux) icon: getIconPath(), // Window icon (Windows, Linux)

View File

@@ -13,7 +13,6 @@ const config = require('../../config')
function init () { function init () {
const win = webtorrent.win = new electron.BrowserWindow({ const win = webtorrent.win = new electron.BrowserWindow({
backgroundColor: '#1E1E1E', backgroundColor: '#1E1E1E',
backgroundThrottling: false, // do not throttle animations/timers when page is background
center: true, center: true,
fullscreen: false, fullscreen: false,
fullscreenable: false, fullscreenable: false,

View File

@@ -279,7 +279,7 @@ module.exports = class TorrentListController {
enabled: torrentSummary.torrentFileName != null enabled: torrentSummary.torrentFileName != null
})) }))
menu.popup(electron.remote.getCurrentWindow()) menu.popup({ window: electron.remote.getCurrentWindow() })
} }
// Takes a torrentSummary or torrentKey // Takes a torrentSummary or torrentKey
@@ -323,7 +323,7 @@ function findFilesRecursive (paths, cb_) {
findFilesRecursive([path], function (fileObjs) { findFilesRecursive([path], function (fileObjs) {
ret.push(...fileObjs) ret.push(...fileObjs)
if (++numComplete === paths.length) { 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) cb_(ret)
} }
}) })

View File

@@ -74,7 +74,7 @@ function getLargestFileByExtension (torrent, extensions) {
* Filter file on a list extension, can be used to find al image files * Filter file on a list extension, can be used to find al image files
* @param torrent Torrent to filter files from * @param torrent Torrent to filter files from
* @param extensions File extensions to filter on * @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) { function filterOnExtension (torrent, extensions) {
return torrent.files.filter(file => { return torrent.files.filter(file => {

View File

@@ -559,7 +559,7 @@ function onBlur () {
} }
function onVisibilityChange () { function onVisibilityChange () {
state.window.isVisible = !document.webkitHidden state.window.isVisible = !document.hidden
} }
function onFullscreenChanged (e, isFullScreen) { function onFullscreenChanged (e, isFullScreen) {

View File

@@ -114,9 +114,9 @@ function renderMedia (state) {
trackTags.push( trackTags.push(
<track <track
key={i} key={i}
default={isSelected ? 'default' : ''} default={isSelected}
label={track.label} label={track.label}
type='subtitles' kind='subtitles'
src={track.buffer} src={track.buffer}
/> />
) )
@@ -546,7 +546,7 @@ function renderPlayerControls (state) {
<div <div
key='scrub-bar' key='scrub-bar'
className='scrub-bar' className='scrub-bar'
draggable='true' draggable
onDragStart={handleDragStart} onDragStart={handleDragStart}
onClick={handleScrub} onClick={handleScrub}
onDrag={handleScrub} onDrag={handleScrub}