Start cleaning up console errors

This commit is contained in:
andytudhope 2019-07-30 12:54:51 +02:00
parent c064f73f95
commit 25bdf2f5cf
8 changed files with 18 additions and 13 deletions

View File

@ -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

View File

@ -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')
}
}

View File

@ -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()

View File

@ -39,7 +39,12 @@ const ProfileContent = ({
.toLowerCase()
.replace('_', ' ')}
</span>
<a href={url} target="_blank" className={styles.button}>
<a
href={url}
target="_blank"
rel="noopener noreferrer"
className={styles.button}
>
Open
</a>
</div>

View File

@ -162,7 +162,7 @@ export const submitAction = (dapp, sntValue) => {
},
dapp.email,
)
if (sntValue == '0') {
if (sntValue === '0') {
dispatch(checkTransactionStatusAction())
return
}

View File

@ -54,7 +54,7 @@ class TransactionStatus extends React.Component {
{published && <div className={styles.status}> Published</div>}
{progress && (
<div className={styles.status}>
<img src={loadingSpinner} />
<img src={loadingSpinner} alt="Loading..." />
Waiting for confirmation of the network...
</div>
)}

View File

@ -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

View File

@ -243,7 +243,7 @@ class Vote extends Component {
<div className={styles.learnMoreCnt}>
<div className={styles.title}>How to submit a ÐApp</div>
<div className={styles.spacing}>
<img src="/images/learn-more-curve.png" />
<img src="/images/learn-more-curve.png" alt="Bonded Curve" />
<p>
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 {
<div className={styles.learnMoreCnt}>
<div className={styles.title}>How to submit a ÐApp</div>
<div className={styles.spacing}>
<img src="/images/learn-more-curve.png" />
<img src="/images/learn-more-curve.png" alt="Bonded Curve" />
<p>
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