Skip to content

Commit

Permalink
fix: behaviour subscribe/unsubscribe discoverd (#1808)
Browse files Browse the repository at this point in the history
- prevent parent element event (prevent event bubbling)
- update fetch user experience expereince data
  • Loading branch information
rubenkristian authored Apr 19, 2023
1 parent 01e5211 commit 2accc05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/components/Expericence/Experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ export const Experience: React.FC<ExperienceProps> = props => {
size="small"
variant="contained"
color="primary"
onClick={() => {
onClick={e => {
e.stopPropagation();

router.push(`/experience/${experienceId}/edit`);
}}>
{i18n.t('Experience.Preview.Button.Edit')}
Expand All @@ -296,11 +298,13 @@ export const Experience: React.FC<ExperienceProps> = props => {
variant="contained"
color="primary"
size="small"
onClick={() =>
onClick={e => {
e.stopPropagation();

isSubscribed
? confirmUnsubscribe()
: handleSubscribeExperience()
}>
: handleSubscribeExperience();
}}>
{isSubscribed
? i18n.t('Experience.Preview.Button.Unsubscribe')
: i18n.t('Experience.Preview.Button.Subscribe')}
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/user/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const UserReducer: Redux.Reducer<UserState, Actions> = (
return {
...state,
experiences: {
data: [...state.experiences.data, ...action.experiences],
data: [...action.experiences],
meta: action.meta,
},
};
Expand Down

0 comments on commit 2accc05

Please sign in to comment.