From a6ab95105a73885a3ba1a06ed65ff7998bc8b4e1 Mon Sep 17 00:00:00 2001 From: liamcardenas Date: Thu, 15 Mar 2018 11:27:47 -0700 Subject: [PATCH] Formatted changes via prettier --- src/renderer/component/fileList/view.jsx | 62 +++++++++++++----------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index c52dd3fda..9c926e825 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -13,34 +13,40 @@ class FileList extends React.PureComponent { }; this._sortFunctions = { - dateNew: fileInfos => this.props.sortByHeight ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id] - ? this.props.claimsById[fileInfo1.claim_id].height - : 0; - const height2 = this.props.claimsById[fileInfo2.claim_id] - ? this.props.claimsById[fileInfo2.claim_id].height - : 0; - if (height1 > height2) { - return -1; - } else if (height1 < height2) { - return 1; - } - return 0; - }) : [...fileInfos].reverse(), - dateOld: fileInfos => this.props.sortByHeight ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id] - ? this.props.claimsById[fileInfo1.claim_id].height - : 999999; - const height2 = this.props.claimsById[fileInfo2.claim_id] - ? this.props.claimsById[fileInfo2.claim_id].height - : 999999; - if (height1 < height2) { - return -1; - } else if (height1 > height2) { - return 1; - } - return 0; - }) : fileInfos, + dateNew: fileInfos => + this.props.sortByHeight + ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { + const height1 = this.props.claimsById[fileInfo1.claim_id] + ? this.props.claimsById[fileInfo1.claim_id].height + : 0; + const height2 = this.props.claimsById[fileInfo2.claim_id] + ? this.props.claimsById[fileInfo2.claim_id].height + : 0; + if (height1 > height2) { + return -1; + } else if (height1 < height2) { + return 1; + } + return 0; + }) + : [...fileInfos].reverse(), + dateOld: fileInfos => + this.props.sortByHeight + ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { + const height1 = this.props.claimsById[fileInfo1.claim_id] + ? this.props.claimsById[fileInfo1.claim_id].height + : 999999; + const height2 = this.props.claimsById[fileInfo2.claim_id] + ? this.props.claimsById[fileInfo2.claim_id].height + : 999999; + if (height1 < height2) { + return -1; + } else if (height1 > height2) { + return 1; + } + return 0; + }) + : fileInfos, title: fileInfos => fileInfos.slice().sort((fileInfo1, fileInfo2) => { const title1 = fileInfo1.value