Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Fix bug 1071780: Don't notify after partial signup
Browse files Browse the repository at this point in the history
  • Loading branch information
openjck committed Sep 23, 2014
1 parent 246882d commit 7e380a6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions media/redesign/js/auth.js
Expand Up @@ -147,14 +147,18 @@
localStorage.removeItem(matchKey);
}

// After seeing the notice, the user tried to sign in with a second
// social account and was successful.
$doc.on('mdn:login', function(service) {
if(matchStored) {
// After seeing the notice, the user took an action that resulted in
// them landing on another page. Either the user abandoned the
// registration process or the user tried to sign in with a second
// social account and was successful. In either case, the
// localStorage item should be immediately removed.
else if(!matchCurrent && matchStored) {
$doc.on('mdn:login', function(service) {
mdn.Notifier.growl('You can now use ' + matchStored + ' to sign in to this MDN profile.', { duration: 0, closable: true }).success();
localStorage.removeItem(matchKey);
}
});
});
localStorage.removeItem(matchKey);
}

}
catch (e) {
// Browser probably doesn't support localStorage
Expand Down

0 comments on commit 7e380a6

Please sign in to comment.