1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Contacts: Don't keep reference to deleted contact.

This commit is contained in:
Thomas Tanghus 2013-02-20 13:14:31 +01:00
parent b7a8ae35bc
commit e8b63a8d65

View File

@ -296,6 +296,9 @@ OC.Contacts = OC.Contacts || {
// App specific events // App specific events
$(document).bind('status.contact.deleted', function(e, data) { $(document).bind('status.contact.deleted', function(e, data) {
var id = parseInt(data.id); var id = parseInt(data.id);
if(id === self.currentid) {
delete self.currentid;
}
console.log('contact', data.id, 'deleted'); console.log('contact', data.id, 'deleted');
// update counts on group lists // update counts on group lists
self.groups.removeFromAll(data.id, true); self.groups.removeFromAll(data.id, true);
@ -427,6 +430,7 @@ OC.Contacts = OC.Contacts || {
$(document).bind('request.contact.delete', function(e, data) { $(document).bind('request.contact.delete', function(e, data) {
var id = parseInt(data.id); var id = parseInt(data.id);
console.log('contact', data.id, 'request.contact.delete'); console.log('contact', data.id, 'request.contact.delete');
self.closeContact(id);
self.contacts.delayedDelete(id); self.contacts.delayedDelete(id);
self.$contactList.removeClass('dim'); self.$contactList.removeClass('dim');
self.showActions(['add']); self.showActions(['add']);