Skip to content

Commit

Permalink
Remove getEventBus helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mgavrila committed Dec 10, 2024
1 parent 32b8ad2 commit 10b0d90
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 40 deletions.
23 changes: 20 additions & 3 deletions src/core/providers/helpers/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { LedgerConnectModal } from '@multiversx/sdk-dapp-core-ui/dist/components/ledger-connect-modal';
import type { WalletConnectModal } from '@multiversx/sdk-dapp-core-ui/dist/components/wallet-connect-modal';

import { defineCustomElements } from '@multiversx/sdk-dapp-core-ui/loader';
import { safeWindow } from 'constants/index';
import { getEventBus } from './getEventBus';
import {
IProviderConfig,
IProviderConfigUI,
Expand Down Expand Up @@ -29,13 +32,27 @@ export const getConfig = async (config: IProviderConfig = defaultConfig) => {
const UI = {
[ProviderTypeEnum.ledger]: {
mount: async () => {
const eventBus = await getEventBus('ledger-connect-modal');
defineCustomElements(safeWindow);
const ledgerModalElement = document.createElement(
'ledger-connect-modal'
) as LedgerConnectModal;

document.body.appendChild(ledgerModalElement);

const eventBus = await ledgerModalElement.getEventBus();
return eventBus;
}
},
[ProviderTypeEnum.walletConnect]: {
mount: async () => {
const eventBus = await getEventBus('wallet-connect-modal');
defineCustomElements(safeWindow);
const walletConnectModalElement = document.createElement(
'wallet-connect-modal'
) as WalletConnectModal;

document.body.appendChild(walletConnectModalElement);
await customElements.whenDefined('wallet-connect-modal');
const eventBus = await walletConnectModalElement.getEventBus();
return eventBus;
}
}
Expand Down
37 changes: 0 additions & 37 deletions src/core/providers/helpers/getEventBus.ts

This file was deleted.

0 comments on commit 10b0d90

Please sign in to comment.