From e8b63a8d65f416b96626281d8167db5a558c381c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 20 Feb 2013 13:14:31 +0100 Subject: [PATCH] Contacts: Don't keep reference to deleted contact. --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index f6cd598e..a37075ec 100644 --- a/js/app.js +++ b/js/app.js @@ -296,6 +296,9 @@ OC.Contacts = OC.Contacts || { // App specific events $(document).bind('status.contact.deleted', function(e, data) { var id = parseInt(data.id); + if(id === self.currentid) { + delete self.currentid; + } console.log('contact', data.id, 'deleted'); // update counts on group lists self.groups.removeFromAll(data.id, true); @@ -427,6 +430,7 @@ OC.Contacts = OC.Contacts || { $(document).bind('request.contact.delete', function(e, data) { var id = parseInt(data.id); console.log('contact', data.id, 'request.contact.delete'); + self.closeContact(id); self.contacts.delayedDelete(id); self.$contactList.removeClass('dim'); self.showActions(['add']);