From b449d1e79301d1f512d3fcafa6ec90625d997d2b Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Wed, 14 Mar 2012 23:06:22 -0600 Subject: [PATCH] wire up buttons of 'is this your computer' - functional but needs work (an extra click, figuring out all the places to ask the question, etc) --- .../dialog/controllers/is_this_your_computer.js | 5 +++-- resources/static/dialog/resources/state.js | 15 +++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/resources/static/dialog/controllers/is_this_your_computer.js b/resources/static/dialog/controllers/is_this_your_computer.js index ed0d43d5e..dcdc35cd8 100644 --- a/resources/static/dialog/controllers/is_this_your_computer.js +++ b/resources/static/dialog/controllers/is_this_your_computer.js @@ -30,11 +30,12 @@ BrowserID.Modules.IsThisYourComputer = (function() { }, yes: function() { - alert("yes!"); + storage.usersComputer.setConfirmed(network.userid()); + this.close("cancel_state"); }, no: function() { - alert("no!"); + this.close("cancel_state"); } }); diff --git a/resources/static/dialog/resources/state.js b/resources/static/dialog/resources/state.js index d6f431159..a6b47c7eb 100644 --- a/resources/static/dialog/resources/state.js +++ b/resources/static/dialog/resources/state.js @@ -17,7 +17,8 @@ BrowserID.State = (function() { addPrimaryUser = false, email, requiredEmail, - primaryVerificationInfo; + primaryVerificationInfo, + isYourComputerAsked = false; function startStateMachine() { var self = this, @@ -78,11 +79,7 @@ BrowserID.State = (function() { }); } else if (authenticated) { - if (storage.usersComputer.confirmed(network.userid())) { - publish("pick_email"); - } else { - publish("is_this_your_computer"); - } + publish("pick_email"); } else { publish("authenticate"); } @@ -182,6 +179,12 @@ BrowserID.State = (function() { }); subscribe("email_chosen", function(msg, info) { + if (!isYourComputerAsked && + !storage.usersComputer.confirmed(network.userid())) { + isYourComputerAsked = true; + publish("is_this_your_computer", info); + return; + } info = info || {}; var email = info.email, -- GitLab