From 26fe2e4adeedcaca9a52c85fbdf03194f26e9a1a Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Mon, 1 Jun 2015 15:29:54 +0900 Subject: [PATCH] make appredirector not check for app if --no-check-for app Also don't check twice going from enter-name.html to index.html --- public/hft/0.x.x/scripts/appredirector.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/public/hft/0.x.x/scripts/appredirector.js b/public/hft/0.x.x/scripts/appredirector.js index 9ef36c28..24e49744 100644 --- a/public/hft/0.x.x/scripts/appredirector.js +++ b/public/hft/0.x.x/scripts/appredirector.js @@ -36,12 +36,13 @@ define([ 'hft/misc/dialog', 'hft/misc/misc', 'hft/misc/mobilehacks', + 'hft/runtime/live-settings', ], function( Cookie, dialog, misc, - mobilehacks) { - + mobilehacks, + liveSettings) { var args = misc.parseUrlQuery(); /** @@ -101,6 +102,18 @@ define([ window.addEventListener('focus', onBlurFocus); if (mobilehacks.isMobile()) { + if (args.checkedForApp) { + console.log("already checked for app"); + options.notInApp(); + return; + } + + if (!liveSettings.system.checkForApp) { + console.log("don't check for app"); + options.notInApp(); + return; + } + // give ourselves a moment to switch to the app setTimeout(checkWasApp, 3000); @@ -109,7 +122,7 @@ define([ goto: options.href || window.location.href, })); } else { - console.log("no mobile so not in app"); + console.log("not mobile so not in app"); options.notInApp(); } } @@ -119,6 +132,7 @@ define([ return misc.objectToSearchString({ cordovaurl: args.cordovaurl, restarturl: args.restarturl, + checkedForApp: true, }); }