From 83a9a37a3d00c8ccfaa1602bfd008efca3a4fdb7 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 22 May 2014 11:26:52 +0200 Subject: [PATCH] Fixed check on connecting to network page It should now only redirect to home when the network is encrypted and there is no form data (or there are no url params). --- js/ConnectingToNetworkPage.js | 9 +++++++-- js/JoinNetworkPage.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/ConnectingToNetworkPage.js b/js/ConnectingToNetworkPage.js index bc66e4f..b25c61d 100644 --- a/js/ConnectingToNetworkPage.js +++ b/js/ConnectingToNetworkPage.js @@ -39,8 +39,13 @@ console.log(PAGE_ID+": pagebeforeshow"); _pageData = d3d.util.getPageParams(PAGE_ID); var form = data.prevPage.find("form"); - // check if there are url params and a form from a prev page - if(_pageData === undefined || form.length === 0) { + // check if there are url params and + // when encrypted if there was a form from a prev page + if(_pageData.encryption === "") { + _pageData.encryption = "none"; + } + if(_pageData === undefined || + (_pageData.encryption !== "none" && form.length === 0)) { $.mobile.changePage("#boxes"); return; } diff --git a/js/JoinNetworkPage.js b/js/JoinNetworkPage.js index c250aca..199d819 100644 --- a/js/JoinNetworkPage.js +++ b/js/JoinNetworkPage.js @@ -73,8 +73,8 @@ var secured = (network.encryption !== "none" && network.encryption !== ""); var link; var icon = ""; + linkParams.encryption = network.encryption; if(secured) { - linkParams.encryption = network.encryption; link = d3d.util.replaceURLParameters(baseSecuredLink,linkParams); icon = "lock"; } else {