From 45f1541b142d4bdf0a380e8c177039c329026171 Mon Sep 17 00:00:00 2001 From: Tudor Morar Date: Tue, 3 Dec 2024 19:15:20 +0200 Subject: [PATCH] Add safewindow guard --- src/core/providers/helpers/getConfig.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/providers/helpers/getConfig.ts b/src/core/providers/helpers/getConfig.ts index 1b92726..70a2b92 100644 --- a/src/core/providers/helpers/getConfig.ts +++ b/src/core/providers/helpers/getConfig.ts @@ -7,6 +7,10 @@ import { } from '../types/providerFactory.types'; export const getConfig = async (config: IProviderConfig = {}) => { + if (!safeWindow.document) { + return config; + } + defineCustomElements(safeWindow); const ledgerModalElement = document.createElement( 'ledger-connect-modal'