diff --git a/ts/features/bonusVacanze/screens/AvailableBonusScreen.tsx b/ts/features/bonusVacanze/screens/AvailableBonusScreen.tsx index b5c88a71ff7..f88fbeac2d5 100644 --- a/ts/features/bonusVacanze/screens/AvailableBonusScreen.tsx +++ b/ts/features/bonusVacanze/screens/AvailableBonusScreen.tsx @@ -16,6 +16,7 @@ import GenericErrorComponent from "../../../components/screens/GenericErrorCompo import FooterWithButtons from "../../../components/ui/FooterWithButtons"; import I18n from "../../../i18n"; import { navigateBack } from "../../../store/actions/navigation"; +import { navigationHistoryPop } from "../../../store/actions/navigationHistory"; import { Dispatch } from "../../../store/actions/types"; import { GlobalState } from "../../../store/reducers/types"; import variables from "../../../theme/variables"; @@ -121,8 +122,10 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ navigateBack: () => dispatch(navigateBack()), loadAvailableBonuses: () => dispatch(availableBonusesLoad.request()), // TODO Add the param to navigate to proper bonus by name (?) - navigateToBonusRequest: (bonusItem: BonusAvailable) => - dispatch(navigateToBonusRequestInformation({ bonusItem })) + navigateToBonusRequest: (bonusItem: BonusAvailable) => { + dispatch(navigateToBonusRequestInformation({ bonusItem })); + dispatch(navigationHistoryPop(1)); + } }); export default connect( diff --git a/ts/features/bonusVacanze/screens/BonusInformationScreen.tsx b/ts/features/bonusVacanze/screens/BonusInformationScreen.tsx index 61b1d62bd16..cf54c2b767e 100644 --- a/ts/features/bonusVacanze/screens/BonusInformationScreen.tsx +++ b/ts/features/bonusVacanze/screens/BonusInformationScreen.tsx @@ -18,6 +18,7 @@ import { LightModalContextInterface } from "../../../components/ui/LightModal"; import Markdown from "../../../components/ui/Markdown"; import I18n from "../../../i18n"; import { navigateBack } from "../../../store/actions/navigation"; +import { navigationHistoryPop } from "../../../store/actions/navigationHistory"; import customVariables from "../../../theme/variables"; import { getLocalePrimaryWithFallback } from "../../../utils/locale"; import { maybeNotNullyString } from "../../../utils/strings"; @@ -215,8 +216,10 @@ const BonusInformationScreen: React.FunctionComponent = props => { }; const mapDispatchToProps = (dispatch: Dispatch) => ({ - // TODO add bonus request action or just navigate to TOS screen (?) - requestBonusActivation: () => dispatch(checkBonusEligibility.request()), + requestBonusActivation: () => { + dispatch(checkBonusEligibility.request()); + dispatch(navigationHistoryPop(1)); + }, navigateBack: () => dispatch(navigateBack()) });