Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Release v1.2.6 - Fix : Private challenges error message#338

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
luizrrodrigues merged 7 commits intomasterfromdevelop
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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": "1.2.6",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
16 changes: 12 additions & 4 deletionssrc/reducers/challenge.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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,
Expand Down
2 changes: 1 addition & 1 deletionsrc/services/challenges.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp