Most wallet adapters rely on injecting their script into window object, resulting our passthrough wallet:
dropping connection on second startup
dropping integrated dApp's connection randomly
custom solflare passthrough handling was needed
Turns out the simplest fix was to stop the wallet adapters from loading, when passThrough is available. So now, no adapter's window object will be affected.
const passThroughWallet = window.Jupiter.passThroughWallet;
const wallets = useMemo(
() => {
if (passThroughWallet) {
return [];
}
return [
new PhantomWalletAdapter(),
new SolflareWalletAdapter(),
new BackpackWalletAdapter(),
new GlowWalletAdapter(),
]
},
[network]
);
Most wallet adapters rely on injecting their script into window object, resulting our passthrough wallet:
Turns out the simplest fix was to stop the wallet adapters from loading, when passThrough is available. So now, no adapter's window object will be affected.