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

[#173400880] Reset navigation history when navigating through bonus list and information #1935

Merged
merged 2 commits into from
Jun 23, 2020
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
7 changes: 5 additions & 2 deletions ts/features/bonusVacanze/screens/AvailableBonusScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 5 additions & 2 deletions ts/features/bonusVacanze/screens/BonusInformationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -215,8 +216,10 @@ const BonusInformationScreen: React.FunctionComponent<Props> = 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())
});

Expand Down