fix for deleting last contact in list
This commit is contained in:
parent
43302b0130
commit
eb9ab56c6e
1 changed files with 2 additions and 2 deletions
|
@ -464,8 +464,8 @@ class ContactsManager(ToxSave):
|
||||||
self._history.delete_history(contact)
|
self._history.delete_history(contact)
|
||||||
|
|
||||||
def _delete_contact(self, num):
|
def _delete_contact(self, num):
|
||||||
|
if num == self._active_contact: # active friend was deleted
|
||||||
|
self.set_active(0 if len(self._contacts) - 1 else -1)
|
||||||
del self._contacts[num]
|
del self._contacts[num]
|
||||||
self._screen.friends_list.takeItem(num)
|
self._screen.friends_list.takeItem(num)
|
||||||
if num == self._active_contact: # active friend was deleted
|
|
||||||
self.set_active(0 if len(self._contacts) else -1)
|
|
||||||
self._save_profile()
|
self._save_profile()
|
||||||
|
|
Loading…
Reference in a new issue