Open fish-yan opened 2 months ago
fix method
export function tryGetWindowKeys(): string[] { const window = getWindow(); if (!window) { return []; } try { return Object.keys(window); } catch { return []; } }
to
export function tryGetWindowKeys(): [string, any][] { const window = getWindow(); if (!window) { return []; } try { return Object.entries(window); } catch { return []; } }
in injected-provider.ts file windowKeys is to get the keys and entries of the window.
injected-provider.ts
windowKeys
export class InjectedProvider<T extends string = string> implements InternalProvider { ... public static getCurrentlyInjectedWallets(): WalletInfoCurrentlyInjected[] { if (!this.window) { return []; } const windowKeys = tryGetWindowKeys(); const wallets = windowKeys.filter(([_, value]) => isJSBridgeWithMetadata(value) ) as unknown as [string, { tonconnect: InjectedWalletApi }][]; ... }
fix method
to
in
injected-provider.ts
filewindowKeys
is to get the keys and entries of the window.