From 78f2b4f3bea0c3c69e6a5921061b6d1e38223a4c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Sep 2019 08:14:24 +0100 Subject: [PATCH] use err.message conditionally, and isChannel from parseURI. --- src/page/file/view.js | 3 +-- src/utils/helper.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/page/file/view.js b/src/page/file/view.js index 236b452..28e623d 100644 --- a/src/page/file/view.js +++ b/src/page/file/view.js @@ -589,8 +589,7 @@ class FilePage extends React.PureComponent { const myChannelUris = channels ? channels.map(channel => channel.permanent_url) : []; const ownedClaim = myClaimUris.includes(uri) || myChannelUris.includes(uri); - const { claimName } = parseURI(uri); - const isChannel = claimName && claimName[0] === '@'; + const { isChannel } = parseURI(uri); let innerContent = null; if ((isResolvingUri && !claim) || !claim) { diff --git a/src/utils/helper.js b/src/utils/helper.js index c2c9597..1f9e76d 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -324,7 +324,7 @@ export function uploadImageAsset(filePath, success, failure) { }) .catch(err => { if (failure) { - failure(err.message); + failure(err.message ? err.message : 'The image failed to upload.'); } }); }