From c2c4c003abaa9f6b0a4b1126362fdc6f4464392a Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 10:57:26 -0400 Subject: [PATCH] if the user updates their email change the email uid mapping, added 500ms delay to the disconnect modal --- public/src/app.js | 12 +++++++----- src/user.js | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 911ba94f9b..9068042fa4 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -33,11 +33,13 @@ var socket, }); socket.on('disconnect', function(data){ - $('#disconnect-modal').modal('show'); - $('#reload-button').on('click',function(){ - $('#disconnect-modal').modal('hide'); - window.location.reload(); - }); + setTimeout(function() { + $('#disconnect-modal').modal('show'); + $('#reload-button').on('click',function(){ + $('#disconnect-modal').modal('hide'); + window.location.reload(); + }); + }, 500); }); }, async: false diff --git a/src/user.js b/src/user.js index 693a4f3b20..0d3dde7a72 100644 --- a/src/user.js +++ b/src/user.js @@ -90,6 +90,7 @@ var config = require('../config.js'), if(key === 'email') { User.setUserField(uid, 'gravatarpicture', User.createGravatarURLFromEmail(data[key])); + RDB.set('email:' + email +':uid', uid); } } } @@ -276,7 +277,7 @@ var config = require('../config.js'), }); RDB.set('username:' + username + ':uid', uid); - RDB.set('email:' + email +':uid', uid); + RDB.set('email:' + email +':uid', uid); if(email) User.sendConfirmationEmail(email);