Skip to content

Commit dec8676

Browse files
committed
fix: private challenge message
1 parent fed3ea1 commit dec8676

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/actions/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { createActions } from 'redux-actions';
1414
export default createActions({
1515
ERRORS: {
1616
CLEAR_ERROR: _.noop,
17-
NEW_ERROR: (title, details) => ({ title, details }),
17+
NEW_ERROR: (title, details, support) => ({ title, details, support }),
1818
CLEAR_ALL_ERROR_ICONS: _.noop,
1919
SET_ERROR_ICON: (id, title, message) => ({ id, title, message }),
2020
CLEAR_ERROR_ICON: id => ({ id }),

src/reducers/challenge.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ function onGetDetailsDone(state, action) {
5555
if (action.payload.message === 'Forbidden') {
5656
fireErrorMessage(
5757
'ERROR: Private challenge',
58-
'This challenge is only available to those in a private group.'
59-
+ ' It looks like you do not have access to this challenge.',
58+
'The challenge is only available to those in a private group.'
59+
+ ' It looks like you are not part of the group.',
60+
'Please work with the challenge creator to get yourself added to the group.',
6061
);
6162
} else {
6263
fireErrorMessage(

src/reducers/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function create(initialState) {
3030
[a.clearError]: state => ({ ...state, alerts: state.alerts.slice(1) }),
3131
[a.newError]: (state, { payload }) => ({
3232
...state,
33-
alerts: [...state.alerts, { title: payload.title, details: payload.details }],
33+
alerts: [...state.alerts, { title: payload.title, details: payload.details, support: payload.support }],
3434
}),
3535
[a.clearAllErrorIcons]: state => ({
3636
...state,

src/utils/errors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export function setErrorsStore(s) {
2222
* The function behaves similarly to javascript alert()
2323
* it will show a modal error diaglog with styling until the user clicks OK.
2424
*/
25-
export function fireErrorMessage(title, details) {
25+
export function fireErrorMessage(title, details, support) {
2626
if (isomorphy.isClientSide() && store) {
2727
setImmediate(() => {
28-
store.dispatch(actions.errors.newError(title, details));
28+
store.dispatch(actions.errors.newError(title, details, support));
2929
});
3030
}
3131
}

0 commit comments

Comments
 (0)