From 67243746aa5ae59c1ded10d36c445a40916b18e2 Mon Sep 17 00:00:00 2001 From: Jed Parsons Date: Sat, 8 Jun 2013 16:17:25 -0700 Subject: [PATCH] Bug 881026 - Closing trusted UI should send null assertion to get() callers. r=benadida --- dom/identity/nsDOMIdentity.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dom/identity/nsDOMIdentity.js b/dom/identity/nsDOMIdentity.js index e0250a61f6f9..9899a84f8f2c 100644 --- a/dom/identity/nsDOMIdentity.js +++ b/dom/identity/nsDOMIdentity.js @@ -213,6 +213,13 @@ nsDOMIdentity.prototype = { opts.siteName = aOptions.siteName || undefined; opts.siteLogo = aOptions.siteLogo || undefined; + opts.oncancel = function get_oncancel() { + if (aCallback) { + aCallback(null); + aCallback = null; + } + }; + if (checkDeprecated(aOptions, "silent")) { // Silent has been deprecated, do nothing. Placing the check here // prevents the callback from being called twice, once with null and @@ -228,12 +235,6 @@ nsDOMIdentity.prototype = { var self = this; this.watch({ _internal: true, - oncancel: function get_oncancel() { - if (aCallback) { - aCallback(null); - aCallback = null; - } - }, onlogin: function get_onlogin(assertion, internalParams) { if (assertion && aCallback && internalParams && !internalParams.silent) { aCallback(assertion);