Formatted changes via prettier
This commit is contained in:
parent
b3ccfc4f19
commit
a6ab95105a
1 changed files with 34 additions and 28 deletions
|
@ -13,34 +13,40 @@ class FileList extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
this._sortFunctions = {
|
this._sortFunctions = {
|
||||||
dateNew: fileInfos => this.props.sortByHeight ? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
dateNew: fileInfos =>
|
||||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
this.props.sortByHeight
|
||||||
? this.props.claimsById[fileInfo1.claim_id].height
|
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
: 0;
|
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
? this.props.claimsById[fileInfo1.claim_id].height
|
||||||
? this.props.claimsById[fileInfo2.claim_id].height
|
: 0;
|
||||||
: 0;
|
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||||
if (height1 > height2) {
|
? this.props.claimsById[fileInfo2.claim_id].height
|
||||||
return -1;
|
: 0;
|
||||||
} else if (height1 < height2) {
|
if (height1 > height2) {
|
||||||
return 1;
|
return -1;
|
||||||
}
|
} else if (height1 < height2) {
|
||||||
return 0;
|
return 1;
|
||||||
}) : [...fileInfos].reverse(),
|
}
|
||||||
dateOld: fileInfos => this.props.sortByHeight ? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
return 0;
|
||||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
})
|
||||||
? this.props.claimsById[fileInfo1.claim_id].height
|
: [...fileInfos].reverse(),
|
||||||
: 999999;
|
dateOld: fileInfos =>
|
||||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
this.props.sortByHeight
|
||||||
? this.props.claimsById[fileInfo2.claim_id].height
|
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
: 999999;
|
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||||
if (height1 < height2) {
|
? this.props.claimsById[fileInfo1.claim_id].height
|
||||||
return -1;
|
: 999999;
|
||||||
} else if (height1 > height2) {
|
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||||
return 1;
|
? this.props.claimsById[fileInfo2.claim_id].height
|
||||||
}
|
: 999999;
|
||||||
return 0;
|
if (height1 < height2) {
|
||||||
}) : fileInfos,
|
return -1;
|
||||||
|
} else if (height1 > height2) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
: fileInfos,
|
||||||
title: fileInfos =>
|
title: fileInfos =>
|
||||||
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
const title1 = fileInfo1.value
|
const title1 = fileInfo1.value
|
||||||
|
|
Loading…
Reference in a new issue