From aa75d75448601a2ee02da4a0de4d436ce57430ba Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Sun, 11 Nov 2018 23:59:38 +0300 Subject: [PATCH] eslint --- src/app/pages-pie.js | 50 ++++++++++----------- src/app/torrent-page.js | 26 +++++------ src/app/torrent.js | 36 +++++++-------- src/app/trackers-images.js | 2 +- src/background/api.js | 2 +- src/background/dbPatcher.js | 36 +++++++-------- src/background/deleteFolderRecursive.js | 22 ++++----- src/background/feed.js | 8 ++-- src/background/p2p.js | 8 ++-- src/background/parsetTorrentFiles.js | 2 +- src/background/spider.js | 4 +- src/background/strategies/rutor.js | 60 ++++++++++++------------- tests/sphinx.test.js | 2 +- 13 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/app/pages-pie.js b/src/app/pages-pie.js index d337854..b0e1497 100644 --- a/src/app/pages-pie.js +++ b/src/app/pages-pie.js @@ -15,31 +15,31 @@ class PagesPie extends Component { delete params.replace; } if (Array.isArray(pages)) { - for (let i in pages) { - this.pie.push({ - Page: pages[i], - params: params - }); - } - } else { - this.pie.push({ - Page: pages, - params: params - }); - } - if(this._mounted) - this.forceUpdate() - } - - componentWillMount() - { - this._mounted = true - } + for (let i in pages) { + this.pie.push({ + Page: pages[i], + params: params + }); + } + } else { + this.pie.push({ + Page: pages, + params: params + }); + } + if(this._mounted) + this.forceUpdate() + } + + componentWillMount() + { + this._mounted = true + } - componentWillUnmount() - { - this._mounted = false - } + componentWillUnmount() + { + this._mounted = false + } close(count) { if (count && typeof count === 'number') { @@ -59,7 +59,7 @@ class PagesPie extends Component { } // ОТРИСОВКА render() { - if (this.pie.length > 0) { + if (this.pie.length > 0) { return (
{ leftIcon={!tree[file].__fileBT ? : contentIcon(fileTypeDetect({path: file}))} rightToggle={ newToggles.length > 0 - ? - selected )} - onToggle={(e, checked) => { - e.preventDefault() - e.stopPropagation() - let toggleValues = {} - newToggles.forEach(({downloadIndex}) => toggleValues[downloadIndex] = checked) - window.torrentSocket.emit('downloadSelectFiles', torrent, toggleValues) - }} - /> - : - null + ? + selected )} + onToggle={(e, checked) => { + e.preventDefault() + e.stopPropagation() + let toggleValues = {} + newToggles.forEach(({downloadIndex}) => toggleValues[downloadIndex] = checked) + window.torrentSocket.emit('downloadSelectFiles', torrent, toggleValues) + }} + /> + : + null } />); diff --git a/src/app/torrent.js b/src/app/torrent.js index 1878b97..24c08d2 100644 --- a/src/app/torrent.js +++ b/src/app/torrent.js @@ -302,13 +302,13 @@ export default class Torrent extends Component { node.onclick = () => { return false } }}>
- { - torrent.info && torrent.info.name - && -
- {torrent.info.name} -
- } + { + torrent.info && torrent.info.name + && +
+ {torrent.info.name} +
+ }
{ @@ -320,17 +320,17 @@ export default class Torrent extends Component { torrent.path && torrent.path.length > 0 ? torrent.path.map((path, index) => { - const boldRe = /\(.+?)\<\/b\>/g; - let boldText; - let newPath = []; - let idx = 0; - while ((boldText = boldRe.exec(path)) !== null) { - newPath.push({path.substring(idx, boldText.index)}); - newPath.push({boldText[1]}); - idx = boldRe.lastIndex; - } - newPath.push({path.substring(idx, path.length)}); - return
{newPath}
+ const boldRe = /\(.+?)\<\/b\>/g; + let boldText; + let newPath = []; + let idx = 0; + while ((boldText = boldRe.exec(path)) !== null) { + newPath.push({path.substring(idx, boldText.index)}); + newPath.push({boldText[1]}); + idx = boldRe.lastIndex; + } + newPath.push({path.substring(idx, path.length)}); + return
{newPath}
}) : null diff --git a/src/app/trackers-images.js b/src/app/trackers-images.js index 9f9d897..ff118de 100644 --- a/src/app/trackers-images.js +++ b/src/app/trackers-images.js @@ -30,7 +30,7 @@ export default (props) => { { info.trackers.includes('rutor') && - + }
) diff --git a/src/background/api.js b/src/background/api.js index 8d6217b..89c694d 100644 --- a/src/background/api.js +++ b/src/background/api.js @@ -243,7 +243,7 @@ module.exports = async ({ sphinxSingle.query(`SELECT * FROM files WHERE hash IN(${inSql})`, (error, files) => { for(const file of files) hashes[file.hash].filesList = parseTorrentFiles(file); - + callback(Object.values(hashes)) }) }) diff --git a/src/background/dbPatcher.js b/src/background/dbPatcher.js index f2ab549..a640141 100644 --- a/src/background/dbPatcher.js +++ b/src/background/dbPatcher.js @@ -74,24 +74,24 @@ module.exports = async (callback, mainWindow, sphinxApp) => { } #one { padding: 20px; - } - #long { - font-size: 0.8em; - padding: 10px; - } - #canBreak { - font-size: 0.8em; - padding: 10px; + } + #long { + font-size: 0.8em; + padding: 10px; + } + #canBreak { + font-size: 0.8em; + padding: 10px; }