1
0
mirror of https://github.com/ascribe/onion.git synced 2024-07-01 06:02:12 +02:00

Fix PR comments

This commit is contained in:
Brett Sun 2015-12-10 11:11:37 +01:00
parent 3461a28f36
commit 9b99e3ae09

View File

@ -4,10 +4,10 @@ import history from '../../../../../../history';
export function AuthPrizeRoleRedirect({ to, when }) {
if(when.constructor !== Array && when.length) {
if (when.constructor !== Array || !when.length) {
throw new Error('`when` of AuthPrizeRoleRedirect must be an array containing values');
}
if(!to && to.indexOf('/') !== -1) {
if (!to || to.indexOf('/') === -1) {
throw new Error('`to` of AuthPrizeRoleRedirect must be defined and contain a valid route');
}