Skip to content

Commit

Permalink
Merge pull request #9187 from hicommonwealth/9185-community-stake-con…
Browse files Browse the repository at this point in the history
…sole-errors

Fix sign in and create community flow
  • Loading branch information
ianrowan authored Sep 11, 2024
2 parents 219519e + ef2ac0f commit d90d964
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MetamaskWebWalletController implements IWebWallet<string> {
public getChainId() {
// We need app.chain? because the app might not be on a page with a chain (e.g homepage),
// and node? because the chain might not have a node provided
return (app.chain?.meta?.ChainNode?.eth_chain_id || 0)?.toString() || '1';
return app.chain?.meta?.ChainNode?.eth_chain_id?.toString() || '1';
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Contest extends ContractBase {

async getContestBalance(): Promise<number> {
if (!this.initialized || !this.walletEnabled) {
await this.initialize(true);
await this.initialize(false);
}
this.reInitContract();
const tokenAddress = await this.contract.methods.contestToken().call();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChainBase } from '@hicommonwealth/shared';
import WebWalletController from 'controllers/app/web_wallets';
import IWebWallet from 'models/IWebWallet';
import { userStore } from 'state/ui/user';
import Web3 from 'web3';
import { AbiItem } from 'web3-utils';

Expand Down Expand Up @@ -33,7 +32,7 @@ abstract class ContractBase {
ChainBase.Ethereum,
)[0];

if (!this.wallet.api && !userStore.getState().isLoggedIn) {
if (!this.wallet.api) {
await this.wallet.enable(chainId);
}
// @ts-expect-error StrictNullChecks
Expand Down

0 comments on commit d90d964

Please sign in to comment.