fix: app breaking with old 'stream' value

This commit is contained in:
Sean Yesmunt 2019-04-30 11:02:04 -04:00
parent cfc584beaa
commit 92e0c9691f
2 changed files with 5 additions and 9 deletions

View file

@ -73,15 +73,11 @@ class FileList extends React.PureComponent<Props> {
[SORT_OPTIONS.TITLE]: fileInfos => [SORT_OPTIONS.TITLE]: fileInfos =>
fileInfos.slice().sort((fileInfo1, fileInfo2) => { fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const getFileTitle = fileInfo => { const getFileTitle = fileInfo => {
const { value, metadata, name, claim_name: claimName } = fileInfo; const { value, name, claim_name: claimName } = fileInfo;
if (metadata) { if (value) {
// downloaded claim return value.title || claimName;
return metadata.title || claimName;
} else if (value) {
// published claim
const { title } = value.stream;
return title || name;
} }
// Invalid claim // Invalid claim
return ''; return '';
}; };

View file

@ -311,7 +311,7 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getState: GetS
// If it's confirmed, check if we should notify the user // If it's confirmed, check if we should notify the user
if (selectosNotificationsEnabled(getState())) { if (selectosNotificationsEnabled(getState())) {
const notif = new window.Notification('LBRY Publish Complete', { const notif = new window.Notification('LBRY Publish Complete', {
body: `${claim.value.stream.title} has been published to lbry://${ body: `${claim.value.title} has been published to lbry://${
claim.name claim.name
}. Click here to view it`, }. Click here to view it`,
silent: false, silent: false,