Skip to content

Commit

Permalink
chore: disable swaps in feegrant and authz mode (#1228)
Browse files Browse the repository at this point in the history
Co-authored-by: chary <57086313+charymalloju@users.noreply.github.com>
  • Loading branch information
Hemanthghs and charymalloju authored May 6, 2024
1 parent 730542f commit 4cb68f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const OverviewPage = ({ chainIDs }: { chainIDs: string[] }) => {
})
);
}
}, [chainIDs]);
}, []);

return (
<div className="w-full flex justify-between">
Expand Down
18 changes: 18 additions & 0 deletions frontend/src/app/(routes)/transfers/components/TransfersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const TransfersPage = ({ chainIDs }: { chainIDs: string[] }) => {

const [tab, setTab] = useState<TransfersTab>(TRANSFERS_TAB1);
const isAuthzMode = useAppSelector((state) => state.authz.authzModeEnabled);
const isFeegrantMode = useAppSelector(
(state) => state.feegrant.feegrantModeEnabled
);

const changeTab = (tab: TransfersTab) => {
if (tab === TRANSFERS_TAB1) setTab(TRANSFERS_TAB2);
else setTab(TRANSFERS_TAB1);
Expand Down Expand Up @@ -79,6 +83,20 @@ const TransfersPage = ({ chainIDs }: { chainIDs: string[] }) => {
'Multi transfer is not available for All networks!',
})
);
} else if (isAuthzMode) {
dispatch(
setError({
type: 'error',
message: 'Swap is not suppported in Authz Mode',
})
);
} else if (isFeegrantMode) {
dispatch(
setError({
type: 'error',
message: 'Swap is not suppported in Feegrant Mode',
})
);
} else {
setSelectedTab(tab);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/custom-hooks/useInitBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const useInitBalances = ({ chainIDs }: { chainIDs: string[] }) => {
})
);
}
}, [chainIDs]);
}, []);
};

export default useInitBalances;

0 comments on commit 4cb68f2

Please sign in to comment.