diff --git a/RELEASE b/RELEASE index 5930d02ea05..03e6ee32ac7 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ IPFS hash of the deployment: -- CIDv0: `QmccrxuuPdXnhgCm2377DmcpBZtS36JK2kHNhGcutyYCfC` -- CIDv1: `bafybeiguflcfu2p2lxehliz5wutxlmqtjfeg7qk4pw2ifw24xbbhjhcf5m` +- CIDv0: `QmSy9dnGZafmGNzzJgdfu97LH9P9HsAZNUTtnfMfAJctRr` +- CIDv1: `bafybeicezboop6s2zwdnk7izhxdkemytiecd3vub4x4564xc2gmio4e3ou` The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org). @@ -10,16 +10,15 @@ You can also access the Uniswap Interface from an IPFS gateway. Your Uniswap settings are never remembered across different URLs. IPFS gateways: -- https://bafybeiguflcfu2p2lxehliz5wutxlmqtjfeg7qk4pw2ifw24xbbhjhcf5m.ipfs.dweb.link/ -- https://bafybeiguflcfu2p2lxehliz5wutxlmqtjfeg7qk4pw2ifw24xbbhjhcf5m.ipfs.cf-ipfs.com/ -- [ipfs://QmccrxuuPdXnhgCm2377DmcpBZtS36JK2kHNhGcutyYCfC/](ipfs://QmccrxuuPdXnhgCm2377DmcpBZtS36JK2kHNhGcutyYCfC/) +- https://bafybeicezboop6s2zwdnk7izhxdkemytiecd3vub4x4564xc2gmio4e3ou.ipfs.dweb.link/ +- https://bafybeicezboop6s2zwdnk7izhxdkemytiecd3vub4x4564xc2gmio4e3ou.ipfs.cf-ipfs.com/ +- [ipfs://QmSy9dnGZafmGNzzJgdfu97LH9P9HsAZNUTtnfMfAJctRr/](ipfs://QmSy9dnGZafmGNzzJgdfu97LH9P9HsAZNUTtnfMfAJctRr/) -### 5.27.7 (2024-05-16) +### 5.27.8 (2024-05-16) ### Bug Fixes -* **web:** support multichain input params 272661d -* **web:** support multichain input params 8620c6c +* **web:** window.ethereum fallback on mobile [prod] (#8260) 929c164 diff --git a/VERSION b/VERSION index 458a48b93bd..0c906b787e7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -web/5.27.7 \ No newline at end of file +web/5.27.8 \ No newline at end of file diff --git a/apps/web/src/components/WalletModal/useOrderedConnections.test.tsx b/apps/web/src/components/WalletModal/useOrderedConnections.test.tsx index 9015d7078bf..c125e99d203 100644 --- a/apps/web/src/components/WalletModal/useOrderedConnections.test.tsx +++ b/apps/web/src/components/WalletModal/useOrderedConnections.test.tsx @@ -126,6 +126,7 @@ describe('useOrderedConnections', () => { }) it('should include the fallback injected provider when no eip6963 injectors are present', async () => { + window.ethereum = true as any mocked(useConnect).mockReturnValue({ connectors: [UNISWAP_MOBILE_CONNECTOR, INJECTED_CONNECTOR, WALLET_CONNECT_CONNECTOR, COINBASE_SDK_CONNECTOR], } as unknown as ReturnType) @@ -136,7 +137,20 @@ describe('useOrderedConnections', () => { { id: CONNECTION.WALLET_CONNECT_CONNECTOR_ID }, { id: CONNECTION.COINBASE_SDK_CONNECTOR_ID }, ] + result.current.forEach((connector, index) => { + expect(connector.id).toEqual(expectedConnectors[index].id) + }) + expect(result.current.length).toEqual(expectedConnectors.length) + }) + it('should include only the fallback injected provider when no eip6963 injectors are present on mobile', async () => { + UserAgentMock.isMobile = true + window.ethereum = true as any + mocked(useConnect).mockReturnValue({ + connectors: [UNISWAP_MOBILE_CONNECTOR, INJECTED_CONNECTOR, WALLET_CONNECT_CONNECTOR, COINBASE_SDK_CONNECTOR], + } as unknown as ReturnType) + const { result } = renderHook(() => useOrderedConnections()) + const expectedConnectors = [{ id: CONNECTION.INJECTED_CONNECTOR_ID }] result.current.forEach((connector, index) => { expect(connector.id).toEqual(expectedConnectors[index].id) }) diff --git a/apps/web/src/components/WalletModal/useOrderedConnections.tsx b/apps/web/src/components/WalletModal/useOrderedConnections.tsx index e1f122e0980..1a8fbe400b8 100644 --- a/apps/web/src/components/WalletModal/useOrderedConnections.tsx +++ b/apps/web/src/components/WalletModal/useOrderedConnections.tsx @@ -53,9 +53,9 @@ function getInjectedConnectors(connectors: readonly Connector[], excludeUniswapC return c.type === CONNECTION.INJECTED_CONNECTOR_TYPE && c.id !== CONNECTION.INJECTED_CONNECTOR_ID }) - // Special-case: Handle deprecated window.ethereum injection when no eip6963 injectors are present. + // Special-case: Return deprecated window.ethereum connector when no eip6963 injectors are present. const fallbackInjector = getConnectorWithId(connectors, CONNECTION.INJECTED_CONNECTOR_ID, { shouldThrow: true }) - if (!injectedConnectors.length && !isMobile) { + if (!injectedConnectors.length && Boolean(window.ethereum)) { return { injectedConnectors: [fallbackInjector], isCoinbaseWalletBrowser } }