From c8cad17f9794d22f6a66916b133d3ed1e2c76e79 Mon Sep 17 00:00:00 2001 From: liamcardenas Date: Thu, 8 Mar 2018 23:32:55 -0800 Subject: [PATCH] Fixed sort after abandoning claim --- src/renderer/component/fileList/view.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index 800fda842..266f5bc58 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -15,8 +15,8 @@ class FileList extends React.PureComponent { this._sortFunctions = { dateNew: fileInfos => fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id].height; - const height2 = this.props.claimsById[fileInfo2.claim_id].height; + 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) { @@ -26,8 +26,8 @@ class FileList extends React.PureComponent { }), dateOld: fileInfos => fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id].height; - const height2 = this.props.claimsById[fileInfo2.claim_id].height; + 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) {