Skip to content

Commit

Permalink
check for window before adding the eventListeners
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Apr 18, 2024
1 parent 170c7bf commit b5296fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/WalletProviderSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export function WalletProviderSelector() {
}

onMount(() => {
if (typeof window === "undefined") return;
window.addEventListener(open, handleOpen);
window.addEventListener(close, handleClose);
window.addEventListener(walletOpen, handleWalletOpen);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function selectWalletProvider(config: Config): Promise<string> {
reject();
cleanup();
}

if (typeof window === "undefined") return;
window.addEventListener(select, handleWalletSelectorSelectEvent);

window.addEventListener(cancel, handleWalletSelectorCancelEvent);
Expand Down

0 comments on commit b5296fa

Please sign in to comment.