Skip to content

Commit

Permalink
Fix setting custom provider
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Dec 6, 2024
1 parent 4bf9a1f commit 8572b26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/providers/ProviderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ export class ProviderFactory {
}

default: {
this._customProviders.forEach(async (customProvider) => {
for (const customProvider of this._customProviders) {
if (customProvider.type === type) {
createdProvider = await customProvider.constructor(config);
createdProvider.getType = () => type;
}
});
}
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import { getState } from 'store/store';

interface ICreateCrossWindowProviderProps {
address?: string;
walletAddress?: string;
}

export async function createCrossWindowProvider({
address = ''
address = '',
walletAddress = ''
}: ICreateCrossWindowProviderProps) {
const network = networkSelector(getState());
const provider = CrossWindowProvider.getInstance();
await provider.init();
provider.setWalletUrl(String(network.walletAddress));
provider.setWalletUrl(walletAddress || network.walletAddress);
provider.setAddress(address);

if (isBrowserWithPopupConfirmation) {
Expand Down

0 comments on commit 8572b26

Please sign in to comment.