jup-ag / terminal

Jupiter Terminal is an open-sourced, lite version of Jupiter that provides end-to-end swap flow by linking it in your HTML.
https://terminal.jup.ag
71 stars 35 forks source link

[0.1.10] Fix wallet passthrough conflict #9

Closed worlddlckgh closed 1 year ago

worlddlckgh commented 1 year ago

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.

const passThroughWallet = window.Jupiter.passThroughWallet;

  const wallets = useMemo(
    () => {
      if (passThroughWallet) {
        return [];
      }

      return [
        new PhantomWalletAdapter(),
        new SolflareWalletAdapter(),
        new BackpackWalletAdapter(),
        new GlowWalletAdapter(),
      ]
    },
    [network]
  );
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
jupiter-terminal ✅ Ready (Inspect) Visit Preview Jan 2, 2023 at 3:42AM (UTC)