Skip to content

Commit

Permalink
make appredirector not check for app if --no-check-for app
Browse files Browse the repository at this point in the history
Also don't check twice going from enter-name.html to index.html
  • Loading branch information
greggman committed Jun 1, 2015
1 parent 2872360 commit 26fe2e4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions public/hft/0.x.x/scripts/appredirector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

/**
Expand Down Expand Up @@ -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);

Expand All @@ -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();
}
}
Expand All @@ -119,6 +132,7 @@ define([
return misc.objectToSearchString({
cordovaurl: args.cordovaurl,
restarturl: args.restarturl,
checkedForApp: true,
});
}

Expand Down

0 comments on commit 26fe2e4

Please sign in to comment.