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; -}