Skip to content

Commit

Permalink
[NO CHANGELOG] [Add Funds Widget] Error Try Again (#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyounglee authored Oct 1, 2024
1 parent 5c44b7d commit 70f6b52
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { AddFundsWidgetViews } from '../../context/view-context/AddFundsViewContextTypes';
import {
initialViewState,
SharedViews,
SharedViews, ViewActions,
ViewContext,
viewReducer,
} from '../../context/view-context/ViewContext';
Expand Down Expand Up @@ -138,6 +138,15 @@ export default function AddFundsWidget({
eventTargetState: { eventTarget },
} = useContext(EventTargetContext);

const errorAction = () => {
viewDispatch({
payload: {
type: ViewActions.UPDATE_VIEW,
view: { type: AddFundsWidgetViews.ADD_FUNDS },
},
});
};

return (
<ViewContext.Provider value={viewReducerValues}>
<AddFundsContext.Provider value={addFundsReducerValues}>
Expand All @@ -156,7 +165,7 @@ export default function AddFundsWidget({
{viewState.view.type === SharedViews.ERROR_VIEW && (
<ErrorView
actionText={t('views.ERROR_VIEW.actionText')}
onActionClick={() => undefined}
onActionClick={errorAction}
onCloseClick={() => sendAddFundsCloseEvent(eventTarget)}
errorEventAction={() => {
page({
Expand Down

0 comments on commit 70f6b52

Please sign in to comment.