Skip to content

Commit

Permalink
fix: token symbol on url (#2535)
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv authored Sep 18, 2024
1 parent ad70d1f commit 7687b84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/state/swap/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -275,6 +275,7 @@ export const useOutputCurrency = () => {
}, [allTokens, toCurrency])

const outputCurrency = useCurrencyV2(token ? token.address : toCurrency)

return outputCurrency || undefined
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7687b84

Please sign in to comment.