Fix type errors

This commit is contained in:
Mathias Rasmussen
2019-10-07 21:43:38 +02:00
parent 3fbf33b8ae
commit e71555e664
9 changed files with 10 additions and 15 deletions

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

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

View File

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