Go back to map when no more hikes are found
This commit is contained in:
@ -45,9 +45,8 @@ export default stampit(React, {
|
|||||||
`/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }`
|
`/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// next questions does not exit
|
// next questions does not exist;
|
||||||
// find next hike
|
debug('finding next hike');
|
||||||
//
|
|
||||||
const nextHike = [].slice.call(hikes)
|
const nextHike = [].slice.call(hikes)
|
||||||
// hikes is in oder of difficulty, lets get reverse order
|
// hikes is in oder of difficulty, lets get reverse order
|
||||||
.reverse()
|
.reverse()
|
||||||
@ -62,7 +61,8 @@ export default stampit(React, {
|
|||||||
if (nextHike) {
|
if (nextHike) {
|
||||||
return this.transitionTo(`/hikes/${ nextHike.dashedName }`);
|
return this.transitionTo(`/hikes/${ nextHike.dashedName }`);
|
||||||
}
|
}
|
||||||
debug('next Hike was not found');
|
debug('next Hike was not found, currentHike %s', currentHike.dashedName);
|
||||||
|
this.transitionTo('/hikes');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user