Skip to content

Commit 9e74f23

Browse files
- toggle widget button is now triggered in wallet service
1 parent 02b0d16 commit 9e74f23

File tree

1 file changed

+0
-9
lines changed
  • packages/plugins/wallet-services-plugin/src

1 file changed

+0
-9
lines changed

packages/plugins/wallet-services-plugin/src/plugin.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
166166
sessionId,
167167
sessionNamespace,
168168
});
169-
if (this.walletInitOptions?.whiteLabel?.showWidgetButton) this.wsEmbedInstance.showTorusButton();
170169
this.subscribeToProviderEvents(this.provider);
171170
this.subscribeToWalletEvents();
172171
this.emit(PLUGIN_EVENTS.CONNECTED);
@@ -216,7 +215,6 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
216215
private subscribeToWalletEvents() {
217216
this.wsEmbedInstance?.provider.on("accountsChanged", (accounts: unknown[] = []) => {
218217
if ((accounts as string[]).length === 0) {
219-
this.wsEmbedInstance.hideTorusButton();
220218
if (this.web3auth?.status === ADAPTER_STATUS.CONNECTED) this.web3auth?.logout();
221219
}
222220
});
@@ -230,12 +228,6 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
230228
provider.on("chainChanged", (chainId: string) => {
231229
this.setChainID(parseInt(chainId, 16));
232230
});
233-
provider.on("disconnect", () => {
234-
this.wsEmbedInstance.hideTorusButton();
235-
});
236-
provider.on("connect", () => {
237-
if (this.walletInitOptions?.whiteLabel?.showWidgetButton) this.wsEmbedInstance.showTorusButton();
238-
});
239231
}
240232

241233
private subscribeToWeb3AuthEvents(web3Auth: IWeb3AuthCore) {
@@ -250,7 +242,6 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
250242
if (this.wsEmbedInstance.isLoggedIn) {
251243
await this.wsEmbedInstance.logout();
252244
}
253-
this.wsEmbedInstance.hideTorusButton();
254245
});
255246
}
256247

0 commit comments

Comments
 (0)