From 06989bbee6502d80b5fbf6d42da0ad7b298df320 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Thu, 15 Mar 2012 00:29:15 -0600
Subject: [PATCH] fix transition after answering the 'is this your computer'
 question - automatically complete signin after answering

---
 .../static/dialog/controllers/is_this_your_computer.js   | 9 ++++++---
 resources/static/shared/network.js                       | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/resources/static/dialog/controllers/is_this_your_computer.js b/resources/static/dialog/controllers/is_this_your_computer.js
index dcdc35cd8..970c7bb9c 100644
--- a/resources/static/dialog/controllers/is_this_your_computer.js
+++ b/resources/static/dialog/controllers/is_this_your_computer.js
@@ -10,12 +10,15 @@ BrowserID.Modules.IsThisYourComputer = (function() {
       user = bid.User,
       network = bid.Network,
       storage = bid.Storage,
-      errors = bid.Errors;
+      errors = bid.Errors,
+      email;
 
   var Module = bid.Modules.PageModule.extend({
     start: function(options) {
       options = options || {};
 
+      email = options.email;
+
       var self = this,
           complete = function(status) {
             options.ready && options.ready(status || false);
@@ -31,11 +34,11 @@ BrowserID.Modules.IsThisYourComputer = (function() {
 
     yes: function() {
       storage.usersComputer.setConfirmed(network.userid());
-      this.close("cancel_state");
+      this.publish("email_chosen", { email: email });
     },
 
     no: function() {
-      this.close("cancel_state");
+      this.publish("email_chosen", { email: email });
     }
 
   });
diff --git a/resources/static/shared/network.js b/resources/static/shared/network.js
index 2ec036d39..5844d6c6e 100644
--- a/resources/static/shared/network.js
+++ b/resources/static/shared/network.js
@@ -499,7 +499,7 @@ BrowserID.Network = (function() {
         data: {
           email: email,
           pubkey: pubkey.serialize(),
-          ephemeral: storage.usersComputer.confirmed(email) ? 
+          ephemeral: !storage.usersComputer.confirmed(email)
         },
         success: onComplete,
         error: onFailure
-- 
GitLab