Skip to content

Pv challenge msg #336

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

Merged
merged 2 commits into from
Apr 27, 2022
Merged
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ jobs:
- attach_workspace:
at: .
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish
- run: npm publish --tag test-release
# dont change anything
workflows:
version: 2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1.2.5",
"version": "v1000.29.0",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
16 changes: 12 additions & 4 deletions src/reducers/challenge.js
Original file line number Diff line number Diff line change
@@ -52,10 +52,18 @@ function onGetDetailsInit(state, action) {
function onGetDetailsDone(state, action) {
if (action.error) {
logger.error('Failed to get challenge details!', action.payload);
fireErrorMessage(
'ERROR: Failed to load the challenge',
'Please, try again a bit later',
);
if (action.payload.message === 'Forbidden') {
fireErrorMessage(
'ERROR: Private challenge',
'This challenge is only available to those in a private group.'
+ ' It looks like you do not have access to this challenge.',
);
} else {
fireErrorMessage(
'ERROR: Failed to load the challenge',
'Please, try again a bit later',
);
}
return {
...state,
fetchChallengeFailure: action.error,
2 changes: 1 addition & 1 deletion src/services/challenges.js
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ async function checkErrorV5(res) {
if (res.status >= 500) {
setErrorIcon(ERROR_ICON_TYPES.API, '/challenges', res.statusText);
}
throw new Error(res.statusText);
throw new Error((!res.statusText && res.status === 403) ? 'Forbidden' : res.statusText);
}
const jsonRes = (await res.json());
if (jsonRes.message) {