Skip to content

Commit

Permalink
Make FMC translation status dependent on actual checkbox value
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Billing committed Sep 6, 2020
1 parent 4723ae8 commit 813e26e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tnoodle-ui/src/components/FmcTranslationsDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const FmcTranslationsDetail = connect(
this.state = { showTranslations: false };
}

handleTranslation = (id) => {
handleTranslation = (id, status) => {
this.props.updateFileZipBlob(null);
this.props.updateTranslation(id);
this.props.updateTranslation(id, status);
};

selectAllTranslations = () => {
Expand Down Expand Up @@ -141,9 +141,9 @@ const FmcTranslationsDetail = connect(
checked={
translation.status
}
onChange={() =>
onChange={(e) =>
this.handleTranslation(
translation.id
translation.id, e.target.checked
)
}
/>
Expand Down
4 changes: 2 additions & 2 deletions tnoodle-ui/src/redux/ActionCreators.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export const updateTranslations = (translations) => ({
payload: { translations },
});

export const updateTranslation = (id) => ({
export const updateTranslation = (id, status) => ({
type: ActionTypes.UPDATE_TRANSLATION,
payload: { id },
payload: { id, status },
});

export const resetTranslations = () => ({
Expand Down
2 changes: 1 addition & 1 deletion tnoodle-ui/src/redux/Reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const Reducer = (store, action) => {
...translation,
status:
translation.id === action.payload.id
? !translation.status
? action.payload.status
: translation.status,
})),
],
Expand Down

0 comments on commit 813e26e

Please sign in to comment.