mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
fixed errors in splash page that appear in develop (#2077)
This commit is contained in:
parent
935eb0b15f
commit
eb9abd23a0
2 changed files with 11 additions and 12 deletions
|
@ -77,13 +77,13 @@ module.exports.getActivity = (username, token) => (dispatch => {
|
||||||
api({
|
api({
|
||||||
uri: `/users/${username}/following/users/activity?limit=5`,
|
uri: `/users/${username}/following/users/activity?limit=5`,
|
||||||
authentication: token
|
authentication: token
|
||||||
}, (err, body) => {
|
}, (err, body, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(module.exports.setFetchStatus('activity', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('activity', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError(err));
|
dispatch(module.exports.setError(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof body === 'undefined') {
|
if (typeof body === 'undefined' || res.statusCode !== 200) {
|
||||||
dispatch(module.exports.setFetchStatus('activity', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('activity', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError('No session content'));
|
dispatch(module.exports.setError('No session content'));
|
||||||
return;
|
return;
|
||||||
|
@ -100,13 +100,13 @@ module.exports.getFeaturedGlobal = () => (dispatch => {
|
||||||
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.FETCHING));
|
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.FETCHING));
|
||||||
api({
|
api({
|
||||||
uri: '/proxy/featured'
|
uri: '/proxy/featured'
|
||||||
}, (err, body) => {
|
}, (err, body, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError(err));
|
dispatch(module.exports.setError(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof body === 'undefined') {
|
if (typeof body === 'undefined' || res.statusCode !== 200) {
|
||||||
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('featured', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError('No session content'));
|
dispatch(module.exports.setError('No session content'));
|
||||||
return;
|
return;
|
||||||
|
@ -126,13 +126,13 @@ module.exports.getSharedByFollowing = (username, token) => (dispatch => {
|
||||||
api({
|
api({
|
||||||
uri: `/users/${username}/following/users/projects`,
|
uri: `/users/${username}/following/users/projects`,
|
||||||
authentication: token
|
authentication: token
|
||||||
}, (err, body) => {
|
}, (err, body, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(module.exports.setFetchStatus('shared', module.exports.Status.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('shared', module.exports.Status.Status.ERROR));
|
||||||
dispatch(module.exports.setError(err));
|
dispatch(module.exports.setError(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof body === 'undefined') {
|
if (typeof body === 'undefined' || res.statusCode !== 200) {
|
||||||
dispatch(module.exports.setFetchStatus('shared', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('shared', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError('No session content'));
|
dispatch(module.exports.setError('No session content'));
|
||||||
return;
|
return;
|
||||||
|
@ -152,13 +152,13 @@ module.exports.getInStudiosFollowing = (username, token) => (dispatch => {
|
||||||
api({
|
api({
|
||||||
uri: `/users/${username}/following/studios/projects`,
|
uri: `/users/${username}/following/studios/projects`,
|
||||||
authentication: token
|
authentication: token
|
||||||
}, (err, body) => {
|
}, (err, body, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(module.exports.setFetchStatus('studios', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('studios', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError(err));
|
dispatch(module.exports.setError(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof body === 'undefined') {
|
if (typeof body === 'undefined' || res.statusCode !== 200) {
|
||||||
dispatch(module.exports.setFetchStatus('studios', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('studios', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError('No session content'));
|
dispatch(module.exports.setError('No session content'));
|
||||||
return;
|
return;
|
||||||
|
@ -178,13 +178,13 @@ module.exports.getLovedByFollowing = (username, token) => (dispatch => {
|
||||||
api({
|
api({
|
||||||
uri: `/users/${username}/following/users/loves`,
|
uri: `/users/${username}/following/users/loves`,
|
||||||
authentication: token
|
authentication: token
|
||||||
}, (err, body) => {
|
}, (err, body, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(module.exports.setFetchStatus('loved', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('loved', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError(err));
|
dispatch(module.exports.setError(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof body === 'undefined') {
|
if (typeof body === 'undefined' || res.statusCode !== 200) {
|
||||||
dispatch(module.exports.setFetchStatus('loved', module.exports.Status.ERROR));
|
dispatch(module.exports.setFetchStatus('loved', module.exports.Status.ERROR));
|
||||||
dispatch(module.exports.setError('No session content'));
|
dispatch(module.exports.setError('No session content'));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -495,7 +495,6 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
]) : []
|
]) : []
|
||||||
}
|
}
|
||||||
|
|
||||||
{featured}
|
{featured}
|
||||||
|
|
||||||
{this.props.isAdmin ? [
|
{this.props.isAdmin ? [
|
||||||
|
@ -555,7 +554,7 @@ SplashPresentation.propTypes = {
|
||||||
isAdmin: PropTypes.bool.isRequired,
|
isAdmin: PropTypes.bool.isRequired,
|
||||||
isEducator: PropTypes.bool.isRequired,
|
isEducator: PropTypes.bool.isRequired,
|
||||||
lovedByFollowing: PropTypes.arrayOf(PropTypes.object),
|
lovedByFollowing: PropTypes.arrayOf(PropTypes.object),
|
||||||
news: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
news: PropTypes.arrayOf(PropTypes.object),
|
||||||
onDismiss: PropTypes.func.isRequired,
|
onDismiss: PropTypes.func.isRequired,
|
||||||
onHideEmailConfirmationModal: PropTypes.func.isRequired,
|
onHideEmailConfirmationModal: PropTypes.func.isRequired,
|
||||||
onRefreshHomepageCache: PropTypes.func.isRequired,
|
onRefreshHomepageCache: PropTypes.func.isRequired,
|
||||||
|
|
Loading…
Reference in a new issue