Skip to content

Commit

Permalink
check on document
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Apr 18, 2024
1 parent fbbfeae commit 75cfe58
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"vite": "5.1.6",
"vite-plugin-dts": "3.7.3",
"vite-plugin-solid": "2.10.1"
},
"dependencies": {
"@sats-connect/ui": "^0.0.4-66a9179"
}
}
2 changes: 2 additions & 0 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const elementId = "sats-connect-wallet-provider-selector";
export const elementName = elementId;

export function getWalletProviderSelectorElement() {
if (typeof window === "undefined" || typeof document === "undefined") return;
return document.getElementById(elementId);
}

Expand All @@ -22,6 +23,7 @@ export function getWalletProviderSelectorElement() {
* definition and adds it to the `<body>`.
*/
export function loadSelector() {
if (typeof window === "undefined" || typeof document === "undefined") return;
if (customElements.get(elementName)) {
return;
}
Expand Down

0 comments on commit 75cfe58

Please sign in to comment.