From 25bdf2f5cf705519ed662feeba6f7bd227ba1044 Mon Sep 17 00:00:00 2001 From: andytudhope Date: Tue, 30 Jul 2019 12:54:51 +0200 Subject: [PATCH] Start cleaning up console errors --- .../services/discover-service/discover-service.js | 8 ++++---- .../services/discover-service/discover-validator.js | 4 ++-- src/common/blockchain/utils.js | 2 +- src/modules/Profile/Profile.jsx | 7 ++++++- src/modules/Submit/Submit.reducer.js | 2 +- src/modules/TransactionStatus/TransactionStatus.jsx | 2 +- .../TransactionStatus/TransactionStatus.reducer.js | 2 +- src/modules/Vote/Vote.jsx | 4 ++-- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/common/blockchain/services/discover-service/discover-service.js b/src/common/blockchain/services/discover-service/discover-service.js index 492e572..a74cb0d 100644 --- a/src/common/blockchain/services/discover-service/discover-service.js +++ b/src/common/blockchain/services/discover-service/discover-service.js @@ -135,7 +135,7 @@ class DiscoverService extends BlockchainService { throw new Error('Searching DApp does not exists') } - if (dapp.id != id) { + if (dapp.id !== id) { throw new Error('Error fetching correct data from contract') } } @@ -145,7 +145,7 @@ class DiscoverService extends BlockchainService { async getDAppDataById(id) { const dapp = await this.getDAppById(id) - if (dapp.metadata.status == 'EMPTY') return EMPTY_METADATA + if (dapp.metadata.status === 'EMPTY') return EMPTY_METADATA try { const dappMetadata = await MetadataClient.retrieveMetadata(dapp.metadata) @@ -173,10 +173,10 @@ class DiscoverService extends BlockchainService { async checkIfCreatorOfDApp(id) { const dapp = await this.getDAppById(id) - if (dapp.metadata.status == 'EMPTY') return false + if (dapp.metadata.status === 'EMPTY') return false this.sharedContext.account = await super.getAccount() - return dapp.developer.toLowerCase() == this.sharedContext.account + return dapp.developer.toLowerCase() === this.sharedContext.account } // Transaction methods diff --git a/src/common/blockchain/services/discover-service/discover-validator.js b/src/common/blockchain/services/discover-service/discover-validator.js index ccd593f..a4f45d6 100644 --- a/src/common/blockchain/services/discover-service/discover-validator.js +++ b/src/common/blockchain/services/discover-service/discover-validator.js @@ -44,7 +44,7 @@ class DiscoverValidator { async validateWithdrawing(id, amount) { const dapp = await this.service.getDAppById(id) - if (dapp.developer.toLowerCase() != this.service.sharedContext.account) { + if (dapp.developer.toLowerCase() !== this.service.sharedContext.account) { throw new Error('Only the developer can withdraw SNT staked on this data') } @@ -58,7 +58,7 @@ class DiscoverValidator { async validateMetadataSet(id) { const dapp = await this.service.getDAppById(id) - if (dapp.developer.toLowerCase() != this.service.sharedContext.account) { + if (dapp.developer.toLowerCase() !== this.service.sharedContext.account) { throw new Error('Only the developer can update the metadata') } } diff --git a/src/common/blockchain/utils.js b/src/common/blockchain/utils.js index 3351bfd..43d22f1 100644 --- a/src/common/blockchain/utils.js +++ b/src/common/blockchain/utils.js @@ -10,7 +10,7 @@ const waitOneMoreBlock = async function(prevBlockNumber) { return new Promise(resolve => { setTimeout(async () => { const blockNumber = await web3.eth.getBlockNumber() - if (prevBlockNumber == blockNumber) { + if (prevBlockNumber === blockNumber) { return waitOneMoreBlock(prevBlockNumber) } resolve() diff --git a/src/modules/Profile/Profile.jsx b/src/modules/Profile/Profile.jsx index 922e88a..353adcf 100644 --- a/src/modules/Profile/Profile.jsx +++ b/src/modules/Profile/Profile.jsx @@ -39,7 +39,12 @@ const ProfileContent = ({ .toLowerCase() .replace('_', ' ')} - + Open diff --git a/src/modules/Submit/Submit.reducer.js b/src/modules/Submit/Submit.reducer.js index 1c46492..7ae0a2c 100644 --- a/src/modules/Submit/Submit.reducer.js +++ b/src/modules/Submit/Submit.reducer.js @@ -162,7 +162,7 @@ export const submitAction = (dapp, sntValue) => { }, dapp.email, ) - if (sntValue == '0') { + if (sntValue === '0') { dispatch(checkTransactionStatusAction()) return } diff --git a/src/modules/TransactionStatus/TransactionStatus.jsx b/src/modules/TransactionStatus/TransactionStatus.jsx index e1d36d3..40df890 100644 --- a/src/modules/TransactionStatus/TransactionStatus.jsx +++ b/src/modules/TransactionStatus/TransactionStatus.jsx @@ -54,7 +54,7 @@ class TransactionStatus extends React.Component { {published &&
✓ Published
} {progress && (
- + Loading... Waiting for confirmation of the network...
)} diff --git a/src/modules/TransactionStatus/TransactionStatus.reducer.js b/src/modules/TransactionStatus/TransactionStatus.reducer.js index 5be6a8c..7be4592 100644 --- a/src/modules/TransactionStatus/TransactionStatus.reducer.js +++ b/src/modules/TransactionStatus/TransactionStatus.reducer.js @@ -40,7 +40,7 @@ export const onChangeTransactionStatusDataAction = transactionStatus => ({ export const checkTransactionStatusAction = tx => { return async dispatch => { const transacationStatus = transactionStatusFetchedInstance() - if (tx == undefined) { + if (tx === undefined) { transacationStatus.setPublishedEmpty(true) dispatch(onChangeTransactionStatusDataAction(transacationStatus)) return diff --git a/src/modules/Vote/Vote.jsx b/src/modules/Vote/Vote.jsx index b400428..72d771b 100644 --- a/src/modules/Vote/Vote.jsx +++ b/src/modules/Vote/Vote.jsx @@ -243,7 +243,7 @@ class Vote extends Component {
How to submit a ÐApp
- + Bonded Curve

This is what the curve you're using really looks like. The more SNT staked on a DApp, the cheaper it becomes for anyone to @@ -281,7 +281,7 @@ class Vote extends Component {

How to submit a ÐApp
- + Bonded Curve

This is what the curve you're using really looks like. The more SNT staked on a DApp, the cheaper it becomes for anyone to