Skip to content

Commit

Permalink
Merge branch 'dev' into timer_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMansour committed May 23, 2022
2 parents c228ddb + 0a08f54 commit 1465682
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
21 changes: 1 addition & 20 deletions packages/react-app/src/components/quest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,31 +173,12 @@ export default function Quest({
}, 500);
}
}
}, [transaction?.type, transaction?.status]);
}, [transaction?.type, transaction?.status, transaction?.args?.questAddress]);

useEffect(() => {
setState(questData.state);
}, [questData.state]);

useEffect(() => {
// If tx completion impact Quest bounty, update it
if (
transaction?.status === ENUM_TRANSACTION_STATUS.Confirmed &&
transaction.args?.questAddress === questData.address &&
(transaction?.type === 'ClaimChallengeResolve' ||
transaction?.type === 'ClaimExecute' ||
transaction?.type === 'QuestFund' ||
transaction?.type === 'QuestReclaimFunds')
) {
setBounty(undefined);
setTimeout(() => {
if (questData.address && questData.rewardToken) {
fetchBalanceOfQuest(questData.address, questData.rewardToken);
}
}, 500);
}
}, [transaction?.type, transaction?.status, transaction?.args?.questAddress]);

useEffect(() => {
if (!questData.rewardToken) {
setBounty(undefined);
Expand Down
6 changes: 3 additions & 3 deletions packages/react-app/src/contexts/wallet.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useContext, useEffect, useMemo, useState } from 'react';
import { getProviderFromUseWalletId } from 'src/ethereum-providers';
import { useWallet, UseWalletProvider } from 'use-wallet';
import { getNetwork } from '../networks';
import { getUseWalletConnectors } from '../utils/web3.utils';
import { getDefaultProvider, getUseWalletConnectors } from '../utils/web3.utils';

export type WalletContextModel = {
walletAddress: string;
Expand Down Expand Up @@ -54,13 +54,13 @@ function WalletAugmented({ children }: Props) {
name: 'Wrong Network',
message: `Please select the ${name} network in your wallet (${connectorInfo?.name}) and try again.`,
});
return null;
return getDefaultProvider();
}

setActivationError(undefined);

if (!ethereum) {
return new EthersProviders.JsonRpcProvider(undefined, chainId);
return getDefaultProvider();
}

const ensRegistry = undefined; // network?.ensRegistry;
Expand Down

0 comments on commit 1465682

Please sign in to comment.