Don’t redirect banned user on comm. guideliens

Goes along with https://github.com/LLK/scratchr2/pull/4127.
This commit is contained in:
Matthew Taylor 2016-10-05 17:49:18 -04:00
parent 603a1336ce
commit e1e9455866

View file

@ -10,6 +10,11 @@ var Types = keyMirror({
SET_STATUS: null
});
const BAN_WHITELIST_PATHS = [
'/accounts/banned-response/',
'/community_guidelines/'
];
module.exports.Status = keyMirror({
FETCHED: null,
NOT_FETCHED: null,
@ -71,7 +76,7 @@ module.exports.refreshSession = function () {
if (
body.user &&
body.user.banned &&
window.location.pathname !== '/accounts/banned-response/') {
BAN_WHITELIST_PATHS.indexOf(window.location.pathname) === -1) {
return window.location = '/accounts/banned-response/';
} else if (
body.flags &&