Skip to content

Commit

Permalink
fix refetchInterval smart route
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Feb 5, 2025
1 parent cfe4cc0 commit 55cdd9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/Toasts/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { initialState } from 'reducer/temporaryConfig';
const defaultOptions: ToastOptions = {
position: 'top-right',
theme: 'dark',
toastId: undefined,
autoClose: 7000,
hideProgressBar: true,
closeOnClick: false,
Expand Down Expand Up @@ -42,6 +43,7 @@ interface IToastExtra {
message: string;
customLink: string;
textLink: string;
toastId?: string;
linkCw20Token?: string;
cw20Address?: string;
linkLpAddress?: string;
Expand Down Expand Up @@ -83,7 +85,7 @@ export type DisplayToastFn = ((
) => void) &
((
type: TToastType.TX_INFO,
extraData?: Partial<Pick<IToastExtra, 'message' | 'customLink' | 'textLink'>>,
extraData?: Partial<Pick<IToastExtra, 'message' | 'toastId' | 'customLink' | 'textLink'>>,
options?: Partial<ToastOptions>
) => void) &
((
Expand Down Expand Up @@ -111,6 +113,7 @@ export const displayToast: DisplayToastFn = (
const inputOptions = {
...defaultOptions,
...refinedOptions,
toastId: extraData?.toastId,
closeOnClick: true
} as ToastOptions;
switch (type) {
Expand Down
1 change: 1 addition & 0 deletions src/helper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ export const handleErrorRateLimit = (errorMsg: string) => {
const fmtMsg = errorMsg.toLowerCase();
if (fmtMsg.includes(`${RATE_LIMIT_CODE}`) || fmtMsg.includes('network error')) {
displayToast(TToastType.TX_INFO, {
toastId: `RATE_LIMIT_CODE`,
message: 'RPC call limit reached. Please wait or switch networks to continue!'
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/UniversalSwap/Swap/hooks/useSimulate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const useSimulate = (
},
{
keepPreviousData: !simulateOption?.keepPreviousData,
refetchInterval: 5000,
refetchInterval: 8000,
staleTime: 2000,
enabled,
onError: (error) => {
Expand Down

0 comments on commit 55cdd9f

Please sign in to comment.