diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index d84e28d0a8..383ce300c3 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -64,7 +64,7 @@ export function useSwapActionHandlers(): { navigate( `/${window.location.pathname.startsWith('/limit') ? 'limit' : 'swap'}/${ NETWORKS_INFO[chainId].route - }/${f}-to-${to}`, + }/${encodeURIComponent(f)}-to-${encodeURIComponent(to)}`, ) }, [fromCurrency, chainId, toCurrency, navigate, allTokens], @@ -275,6 +275,7 @@ export const useOutputCurrency = () => { }, [allTokens, toCurrency]) const outputCurrency = useCurrencyV2(token ? token.address : toCurrency) + return outputCurrency || undefined } diff --git a/src/utils/string.ts b/src/utils/string.ts index e782e1ec4e..b9dff753c2 100644 --- a/src/utils/string.ts +++ b/src/utils/string.ts @@ -18,7 +18,7 @@ export function convertToSlug(text: string) { } export const getSymbolSlug = (token: Currency | Token | undefined) => - token ? convertToSlug(token?.symbol || token?.wrapped?.symbol || '') : '' + token ? (token?.symbol || token?.wrapped?.symbol || '').toLowerCase() : '' export const queryStringToObject = (queryString: string) => { return parse(queryString.startsWith('?') ? queryString.substring(1) : queryString)