Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09054530c8 | ||
|
|
1990d42ebd | ||
|
|
d8977fce36 | ||
|
|
b766385722 | ||
|
|
ac4ee875f9 | ||
|
|
f417dbebc0 |
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@ -0,0 +1 @@
|
|||||||
|
@uniswap/web-admins
|
||||||
@ -22,7 +22,7 @@ describe('disconnect wallet', () => {
|
|||||||
cy.contains('Connect Wallet')
|
cy.contains('Connect Wallet')
|
||||||
|
|
||||||
// Verify swap input is cleared
|
// Verify swap input is cleared
|
||||||
cy.get('#swap-currency-input .token-amount-input').should('have.value', '1')
|
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -77,6 +77,7 @@ function Loader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Success = styled(AnimatedEntranceConfirmationIcon)`
|
const Success = styled(AnimatedEntranceConfirmationIcon)`
|
||||||
|
position: relative;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,8 @@ function findCancelTx(localActivity: Activity, remoteMap: ActivityMap, account:
|
|||||||
if (
|
if (
|
||||||
remoteTx.nonce === localActivity.nonce &&
|
remoteTx.nonce === localActivity.nonce &&
|
||||||
remoteTx.from.toLowerCase() === account.toLowerCase() &&
|
remoteTx.from.toLowerCase() === account.toLowerCase() &&
|
||||||
remoteTx.hash.toLowerCase() !== localActivity.hash.toLowerCase()
|
remoteTx.hash.toLowerCase() !== localActivity.hash.toLowerCase() &&
|
||||||
|
remoteTx.chainId === localActivity.chainId
|
||||||
) {
|
) {
|
||||||
return remoteTx.hash
|
return remoteTx.hash
|
||||||
}
|
}
|
||||||
@ -37,6 +38,11 @@ function combineActivities(localMap: ActivityMap = {}, remoteMap: ActivityMap =
|
|||||||
const remoteActivity = (remoteMap?.[hash] ?? {}) as Activity
|
const remoteActivity = (remoteMap?.[hash] ?? {}) as Activity
|
||||||
|
|
||||||
if (localActivity.cancelled) {
|
if (localActivity.cancelled) {
|
||||||
|
// Hides misleading activities caused by cross-chain nonce collisions previously being incorrectly labelled as cancelled txs in redux
|
||||||
|
if (localActivity.chainId !== remoteActivity.chainId) {
|
||||||
|
acc.push(remoteActivity)
|
||||||
|
return acc
|
||||||
|
}
|
||||||
// Remote data only contains data of the cancel tx, rather than the original tx, so we prefer local data here
|
// Remote data only contains data of the cancel tx, rather than the original tx, so we prefer local data here
|
||||||
acc.push(localActivity)
|
acc.push(localActivity)
|
||||||
} else {
|
} else {
|
||||||
@ -67,6 +73,7 @@ export function useAllActivities(account: string) {
|
|||||||
if (!localActivity) return
|
if (!localActivity) return
|
||||||
|
|
||||||
const cancelHash = findCancelTx(localActivity, remoteMap, account)
|
const cancelHash = findCancelTx(localActivity, remoteMap, account)
|
||||||
|
|
||||||
if (cancelHash) updateCancelledTx(localActivity.hash, localActivity.chainId, cancelHash)
|
if (cancelHash) updateCancelledTx(localActivity.hash, localActivity.chainId, cancelHash)
|
||||||
})
|
})
|
||||||
}, [account, localMap, remoteMap, updateCancelledTx])
|
}, [account, localMap, remoteMap, updateCancelledTx])
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { TraceJsonRpcVariant, useTraceJsonRpcFlag } from 'featureFlags/flags/tra
|
|||||||
import useEagerlyConnect from 'hooks/useEagerlyConnect'
|
import useEagerlyConnect from 'hooks/useEagerlyConnect'
|
||||||
import useOrderedConnections from 'hooks/useOrderedConnections'
|
import useOrderedConnections from 'hooks/useOrderedConnections'
|
||||||
import usePrevious from 'hooks/usePrevious'
|
import usePrevious from 'hooks/usePrevious'
|
||||||
import { ReactNode, useEffect } from 'react'
|
import { ReactNode, useEffect, useMemo, useState } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { useConnectedWallets } from 'state/wallets/hooks'
|
import { useConnectedWallets } from 'state/wallets/hooks'
|
||||||
import { getCurrentPageFromLocation } from 'utils/urlRoutes'
|
import { getCurrentPageFromLocation } from 'utils/urlRoutes'
|
||||||
@ -20,8 +20,16 @@ export default function Web3Provider({ children }: { children: ReactNode }) {
|
|||||||
const connections = useOrderedConnections()
|
const connections = useOrderedConnections()
|
||||||
const connectors: [Connector, Web3ReactHooks][] = connections.map(({ hooks, connector }) => [connector, hooks])
|
const connectors: [Connector, Web3ReactHooks][] = connections.map(({ hooks, connector }) => [connector, hooks])
|
||||||
|
|
||||||
|
// Force a re-render when our connection state changes.
|
||||||
|
const [index, setIndex] = useState(0)
|
||||||
|
useEffect(() => setIndex((index) => index + 1), [connections])
|
||||||
|
const key = useMemo(
|
||||||
|
() => connections.map((connection) => connection.getName()).join('-') + index,
|
||||||
|
[connections, index]
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Web3ReactProvider connectors={connectors}>
|
<Web3ReactProvider connectors={connectors} key={key}>
|
||||||
<Updater />
|
<Updater />
|
||||||
{children}
|
{children}
|
||||||
</Web3ReactProvider>
|
</Web3ReactProvider>
|
||||||
|
|||||||
@ -265,13 +265,10 @@ export function PendingModalContent({
|
|||||||
const { chainId } = useWeb3React()
|
const { chainId } = useWeb3React()
|
||||||
|
|
||||||
const swapStatus = useSwapTransactionStatus(swapResult)
|
const swapStatus = useSwapTransactionStatus(swapResult)
|
||||||
|
const order = useOrder(swapResult?.type === TradeFillType.UniswapX ? swapResult.response.orderHash : '')
|
||||||
|
|
||||||
const classicSwapConfirmed = swapStatus === TransactionStatus.Confirmed
|
const swapConfirmed = swapStatus === TransactionStatus.Confirmed || order?.status === UniswapXOrderStatus.FILLED
|
||||||
const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash)
|
const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash)
|
||||||
// TODO(UniswapX): Support UniswapX status here too
|
|
||||||
const uniswapXSwapConfirmed = Boolean(swapResult)
|
|
||||||
|
|
||||||
const swapConfirmed = swapResult?.type === TradeFillType.Classic ? classicSwapConfirmed : uniswapXSwapConfirmed
|
|
||||||
|
|
||||||
const swapPending = swapResult !== undefined && !swapConfirmed
|
const swapPending = swapResult !== undefined && !swapConfirmed
|
||||||
const wrapPending = wrapTxHash != undefined && !wrapConfirmed
|
const wrapPending = wrapTxHash != undefined && !wrapConfirmed
|
||||||
@ -288,8 +285,6 @@ export function PendingModalContent({
|
|||||||
chainId,
|
chainId,
|
||||||
})
|
})
|
||||||
|
|
||||||
const order = useOrder(swapResult?.type === TradeFillType.UniswapX ? swapResult.response.orderHash : '')
|
|
||||||
|
|
||||||
const currentStepContainerRef = useRef<HTMLDivElement>(null)
|
const currentStepContainerRef = useRef<HTMLDivElement>(null)
|
||||||
useUnmountingAnimation(currentStepContainerRef, () => AnimationType.EXITING)
|
useUnmountingAnimation(currentStepContainerRef, () => AnimationType.EXITING)
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getConnection } from 'connection'
|
import { getConnection } from 'connection'
|
||||||
import { ConnectionType } from 'connection/types'
|
import { ConnectionType } from 'connection/types'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
|
import { useAppSelector } from 'state/hooks'
|
||||||
|
|
||||||
const SELECTABLE_WALLETS = [
|
const SELECTABLE_WALLETS = [
|
||||||
ConnectionType.UNISWAP_WALLET_V2,
|
ConnectionType.UNISWAP_WALLET_V2,
|
||||||
@ -10,17 +11,23 @@ const SELECTABLE_WALLETS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export default function useOrderedConnections() {
|
export default function useOrderedConnections() {
|
||||||
|
const selectedWallet = useAppSelector((state) => state.user.selectedWallet)
|
||||||
|
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
const orderedConnectionTypes: ConnectionType[] = []
|
const orderedConnectionTypes: ConnectionType[] = []
|
||||||
|
|
||||||
// Always attempt to use to Gnosis Safe first, as we can't know if we're in a SafeContext.
|
// Always attempt to use to Gnosis Safe first, as we can't know if we're in a SafeContext.
|
||||||
orderedConnectionTypes.push(ConnectionType.GNOSIS_SAFE)
|
orderedConnectionTypes.push(ConnectionType.GNOSIS_SAFE)
|
||||||
|
|
||||||
orderedConnectionTypes.push(...SELECTABLE_WALLETS)
|
// Add the `selectedWallet` to the top so it's prioritized, then add the other selectable wallets.
|
||||||
|
if (selectedWallet) {
|
||||||
|
orderedConnectionTypes.push(selectedWallet)
|
||||||
|
}
|
||||||
|
orderedConnectionTypes.push(...SELECTABLE_WALLETS.filter((wallet) => wallet !== selectedWallet))
|
||||||
|
|
||||||
// Add network connection last as it should be the fallback.
|
// Add network connection last as it should be the fallback.
|
||||||
orderedConnectionTypes.push(ConnectionType.NETWORK)
|
orderedConnectionTypes.push(ConnectionType.NETWORK)
|
||||||
|
|
||||||
return orderedConnectionTypes.map((connectionType) => getConnection(connectionType))
|
return orderedConnectionTypes.map((connectionType) => getConnection(connectionType))
|
||||||
}, [])
|
}, [selectedWallet])
|
||||||
}
|
}
|
||||||
|
|||||||
3701
src/locales/af-ZA.po
Normal file
3701
src/locales/af-ZA.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ar-SA.po
Normal file
3701
src/locales/ar-SA.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ca-ES.po
Normal file
3701
src/locales/ca-ES.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/cs-CZ.po
Normal file
3701
src/locales/cs-CZ.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/da-DK.po
Normal file
3701
src/locales/da-DK.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/de-DE.po
Normal file
3701
src/locales/de-DE.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/el-GR.po
Normal file
3701
src/locales/el-GR.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/es-ES.po
Normal file
3701
src/locales/es-ES.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/fi-FI.po
Normal file
3701
src/locales/fi-FI.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/fr-FR.po
Normal file
3701
src/locales/fr-FR.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/he-IL.po
Normal file
3701
src/locales/he-IL.po
Normal file
File diff suppressed because it is too large
Load Diff
3702
src/locales/hu-HU.po
Normal file
3702
src/locales/hu-HU.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/id-ID.po
Normal file
3701
src/locales/id-ID.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/it-IT.po
Normal file
3701
src/locales/it-IT.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ja-JP.po
Normal file
3701
src/locales/ja-JP.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ko-KR.po
Normal file
3701
src/locales/ko-KR.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/nl-NL.po
Normal file
3701
src/locales/nl-NL.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/no-NO.po
Normal file
3701
src/locales/no-NO.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/pl-PL.po
Normal file
3701
src/locales/pl-PL.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/pt-BR.po
Normal file
3701
src/locales/pt-BR.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/pt-PT.po
Normal file
3701
src/locales/pt-PT.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ro-RO.po
Normal file
3701
src/locales/ro-RO.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/ru-RU.po
Normal file
3701
src/locales/ru-RU.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/sl-SI.po
Normal file
3701
src/locales/sl-SI.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/sr-SP.po
Normal file
3701
src/locales/sr-SP.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/sv-SE.po
Normal file
3701
src/locales/sv-SE.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/sw-TZ.po
Normal file
3701
src/locales/sw-TZ.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/th-TH.po
Normal file
3701
src/locales/th-TH.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/tr-TR.po
Normal file
3701
src/locales/tr-TR.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/uk-UA.po
Normal file
3701
src/locales/uk-UA.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/vi-VN.po
Normal file
3701
src/locales/vi-VN.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/zh-CN.po
Normal file
3701
src/locales/zh-CN.po
Normal file
File diff suppressed because it is too large
Load Diff
3701
src/locales/zh-TW.po
Normal file
3701
src/locales/zh-TW.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -128,8 +128,9 @@ export const routingApi = createApi({
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
async queryFn(args, _api, _extraOptions, fetch) {
|
async queryFn(args, _api, _extraOptions, fetch) {
|
||||||
const fellBack = false
|
let fellBack = false
|
||||||
if (shouldUseAPIRouter(args)) {
|
if (shouldUseAPIRouter(args)) {
|
||||||
|
fellBack = true
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
tokenInAddress,
|
tokenInAddress,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user