Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: crash page when creating pool #2361

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/SwapForm/hooks/useBuildRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const useBuildRoute = (args: Args) => {
slippageTolerance: slippage,
sender: account,
recipient: to || account,
source: clientId || 'kyberswap',
source: clientId || 'kyberswap-ui',
skipSimulateTx: false,
permit,
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const CAMPAIGN_LEADERBOARD_ITEM_PER_PAGE = 10
export const CAMPAIGN_YOUR_TRANSACTIONS_ITEM_PER_PAGE = 10000

export const ELASTIC_BASE_FEE_UNIT = 100_000
export const KYBERSWAP_SOURCE = '{"source":"kyberswap"}'
export const KYBERSWAP_SOURCE = '{"source":"kyberswap-ui"}'

export const SWR_KEYS = {
getGrantProgramLeaderBoard: (id: number | string) => `${CAMPAIGN_BASE_URL}/api/v1/competitions/${id}/leaderboard`,
Expand Down
4 changes: 2 additions & 2 deletions src/services/route/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const routeApi = createApi({
params,
authentication,
headers: {
'x-client-id': clientId || 'kyberswap',
'x-client-id': clientId || 'kyberswap-ui',
},
}),
}),
Expand All @@ -39,7 +39,7 @@ const routeApi = createApi({
signal,
authentication,
headers: {
'x-client-id': payload.source || 'kyberswap',
'x-client-id': payload.source || 'kyberswap-ui',
},
}),
}),
Expand Down
2 changes: 2 additions & 0 deletions src/state/swap/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export function tryParseAmount<T extends Currency>(
const typedValueParsed = parseFraction(value)
.multiply(scaleDecimals ? 10 ** currency.decimals : 1)
.toFixed(0)

if (typedValueParsed === '0') return undefined
const result = CurrencyAmount.fromRawAmount(currency, typedValueParsed)
return result
} catch (error) {
Expand Down
Loading