From a1f58b2a07b1fc21b03964829c1f1c62b1a41b8b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 25 Oct 2019 16:42:16 +0100 Subject: [PATCH] fixes per review --- src/page/publishes/view.js | 4 ++-- src/utils/helper.js | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/page/publishes/view.js b/src/page/publishes/view.js index 38b088a..fb7bf41 100644 --- a/src/page/publishes/view.js +++ b/src/page/publishes/view.js @@ -8,7 +8,7 @@ import FileListItem from 'component/fileListItem'; import FloatingWalletBalance from 'component/floatingWalletBalance'; import UriBar from 'component/uriBar'; import publishStyle from 'styles/publish'; -import { __, isClaimInList, navigateToUri } from 'utils/helper'; +import { __, navigateToUri } from 'utils/helper'; class PublishesPage extends React.PureComponent { state = { @@ -175,7 +175,7 @@ class PublishesPage extends React.PureComponent { this.handleSelectItem(item, claim); } else { const { notify, pendingClaims } = this.props; - if (isClaimInList(claim, pendingClaims)) { + if (pendingClaims.some(pendingClaim => pendingClaim.claim_id === claim.claim_id)) { notify({ message: __('This content is currently pending. It will be available in a few minutes.'), }); diff --git a/src/utils/helper.js b/src/utils/helper.js index 9b3f1e2..0126067 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -346,14 +346,3 @@ export function uploadImageAsset(filePath, success, failure) { } }); } - -// TODO: This method already exists elsewhere? -export function isClaimInList(claim, claims = []) { - for (let i = 0; i < claims.length; i++) { - if (claims[i].claim_id === claim.claim_id) { - return true; - } - } - - return false; -}