Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sign in and create community flow #9187

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading