Upgrade daemon to 0.19.0 #1032

Merged
liamcardenas merged 15 commits from daemon19 into master 2018-03-09 08:53:39 +01:00
2 changed files with 22 additions and 23 deletions
Showing only changes of commit bd785502f4 - Show all commits

View file

@ -1,8 +1,11 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import FileList from './view'; import FileList from './view';
import { selectClaimsById } from 'redux/selectors/claims';
const select = state => ({}); const select = state => ({
claimsById: selectClaimsById(state),
});
const perform = dispatch => ({}); const perform = dispatch => ({});

View file

@ -13,32 +13,30 @@ class FileList extends React.PureComponent {
}; };
this._sortFunctions = { this._sortFunctions = {
dateNew(fileInfos) { dateNew: (fileInfos) =>
return fileInfos.slice().sort((fileInfo1, fileInfo2) => { fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const height1 = fileInfo1.height; const height1 = this.props.claimsById[fileInfo1.claim_id].height;
const height2 = fileInfo2.height; const height2 = this.props.claimsById[fileInfo2.claim_id].height;
if (height1 > height2) { if (height1 > height2) {
return -1; return -1;
} else if (height1 < height2) { } else if (height1 < height2) {
return 1; return 1;
} }
return 0; return 0;
}); }),
}, dateOld: (fileInfos) =>
dateOld(fileInfos) { fileInfos.slice().sort((fileInfo1, fileInfo2) => {
return fileInfos.slice().sort((fileInfo1, fileInfo2) => { const height1 = this.props.claimsById[fileInfo1.claim_id].height;
const height1 = fileInfo1.height; const height2 = this.props.claimsById[fileInfo2.claim_id].height;
const height2 = fileInfo2.height;
if (height1 < height2) { if (height1 < height2) {
return -1; return -1;
} else if (height1 > height2) { } else if (height1 > height2) {
return 1; return 1;
} }
return 0; return 0;
}); }),
}, title: (fileInfos) =>
title(fileInfos) { fileInfos.slice().sort((fileInfo1, fileInfo2) => {
return fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const title1 = fileInfo1.value const title1 = fileInfo1.value
? fileInfo1.value.stream.metadata.title.toLowerCase() ? fileInfo1.value.stream.metadata.title.toLowerCase()
: fileInfo1.claim_name; : fileInfo1.claim_name;
@ -51,10 +49,9 @@ class FileList extends React.PureComponent {
return 1; return 1;
} }
return 0; return 0;
}); }),
}, filename: (fileInfos) =>
filename(fileInfos) { fileInfos.slice().sort(({ file_name: fileName1 }, { file_name: fileName2 }) => {
return fileInfos.slice().sort(({ file_name: fileName1 }, { file_name: fileName2 }) => {
const fileName1Lower = fileName1.toLowerCase(); const fileName1Lower = fileName1.toLowerCase();
const fileName2Lower = fileName2.toLowerCase(); const fileName2Lower = fileName2.toLowerCase();
if (fileName1Lower < fileName2Lower) { if (fileName1Lower < fileName2Lower) {
@ -63,10 +60,9 @@ class FileList extends React.PureComponent {
return 1; return 1;
} }
return 0; return 0;
}); }),
}, };
}; }
}
getChannelSignature(fileInfo) { getChannelSignature(fileInfo) {
if (fileInfo.value) { if (fileInfo.value) {