Commit 7a3c51bc authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix: uniswap_wallet -> uniwallet (#6764)

* fix: uniswap_wallet -> uniwallet

update tests

Revert "fix: uniswap_wallet -> uniwallet"

This reverts commit 7bdf34b33025d0b564c5870b073eb20e3d1774e1.

Revert "update tests"

This reverts commit cc841cb5e01a1a239f79fa4d9d480e6479128f08.

add migration

* refactor: add deprecated value back to enum (#6768)

* add deprecated value back to enum

* Update src/connection/types.ts
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

---------
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

* add deprecated case to getConnection

---------
Co-authored-by: default avatarCharles Bachmeier <charles@bachmeier.io>
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>
parent e69a7c27
...@@ -173,6 +173,7 @@ export function getConnection(c: Connector | ConnectionType) { ...@@ -173,6 +173,7 @@ export function getConnection(c: Connector | ConnectionType) {
return walletConnectConnection return walletConnectConnection
case ConnectionType.WALLET_CONNECT_V2: case ConnectionType.WALLET_CONNECT_V2:
return walletConnectV2Connection return walletConnectV2Connection
case ConnectionType.UNIWALLET:
case ConnectionType.UNISWAP_WALLET: case ConnectionType.UNISWAP_WALLET:
return uniwalletConnectConnection return uniwalletConnectConnection
case ConnectionType.NETWORK: case ConnectionType.NETWORK:
......
...@@ -3,6 +3,8 @@ import { Connector } from '@web3-react/types' ...@@ -3,6 +3,8 @@ import { Connector } from '@web3-react/types'
export enum ConnectionType { export enum ConnectionType {
UNISWAP_WALLET = 'UNISWAP_WALLET', UNISWAP_WALLET = 'UNISWAP_WALLET',
/** @deprecated - Use {@link UNISWAP_WALLET} instead. */
UNIWALLET = 'UNIWALLET',
INJECTED = 'INJECTED', INJECTED = 'INJECTED',
COINBASE_WALLET = 'COINBASE_WALLET', COINBASE_WALLET = 'COINBASE_WALLET',
WALLET_CONNECT = 'WALLET_CONNECT', WALLET_CONNECT = 'WALLET_CONNECT',
......
...@@ -131,6 +131,11 @@ const userSlice = createSlice({ ...@@ -131,6 +131,11 @@ const userSlice = createSlice({
// for all existing users with a previous version of the state in their localStorage. // for all existing users with a previous version of the state in their localStorage.
// In order to avoid this, we need to set a default value for each new property manually during hydration. // In order to avoid this, we need to set a default value for each new property manually during hydration.
builder.addCase(updateVersion, (state) => { builder.addCase(updateVersion, (state) => {
// If `selectedWallet` is ConnectionType.UNI_WALLET (deprecated) switch it to ConnectionType.UNISWAP_WALLET
if (state.selectedWallet === 'UNIWALLET') {
state.selectedWallet = ConnectionType.UNISWAP_WALLET
}
// If `userSlippageTolerance` is not present or its value is invalid, reset to default // If `userSlippageTolerance` is not present or its value is invalid, reset to default
if ( if (
typeof state.userSlippageTolerance !== 'number' || typeof state.userSlippageTolerance !== 'number' ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment