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,
message: data.message,
detail: data.detail
}, noop)
})
}
function noop () {}

View File

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

View File

@@ -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()
}

View File

@@ -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)

View File

@@ -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,

View File

@@ -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)
}
})

View File

@@ -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 => {

View File

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

View File

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