From f735572b6e885ec17f062e68a4e7f1bef0282fea Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sun, 19 Jul 2015 10:39:50 -0700 Subject: [PATCH] Go back to map when no more hikes are found --- common/app/routes/Hikes/components/Question.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/app/routes/Hikes/components/Question.jsx b/common/app/routes/Hikes/components/Question.jsx index bc2dabc283..f54cec2f7f 100644 --- a/common/app/routes/Hikes/components/Question.jsx +++ b/common/app/routes/Hikes/components/Question.jsx @@ -45,9 +45,8 @@ export default stampit(React, { `/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }` ); } - // next questions does not exit - // find next hike - // + // next questions does not exist; + debug('finding next hike'); const nextHike = [].slice.call(hikes) // hikes is in oder of difficulty, lets get reverse order .reverse() @@ -62,7 +61,8 @@ export default stampit(React, { if (nextHike) { 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'); }); },