mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Only remove PendingContact from UI when removed from DB
This commit is contained in:
@@ -86,8 +86,8 @@ public class PendingContactListActivity extends BriarActivity
|
||||
|
||||
@Override
|
||||
public void onFailedPendingContactRemoved(PendingContact pendingContact) {
|
||||
adapter.remove(pendingContact);
|
||||
viewModel.removePendingContact(pendingContact);
|
||||
viewModel.removePendingContact(pendingContact,
|
||||
() -> adapter.remove(pendingContact));
|
||||
}
|
||||
|
||||
private void onPendingContactsChanged(Collection<PendingContact> contacts) {
|
||||
|
||||
@@ -81,10 +81,12 @@ public class PendingContactListViewModel extends AndroidViewModel
|
||||
return pendingContacts;
|
||||
}
|
||||
|
||||
void removePendingContact(PendingContact pendingContact) {
|
||||
void removePendingContact(PendingContact pendingContact,
|
||||
Runnable commitAction) {
|
||||
dbExecutor.execute(() -> {
|
||||
try {
|
||||
contactManager.removePendingContact(pendingContact);
|
||||
contactManager
|
||||
.removePendingContact(pendingContact, commitAction);
|
||||
} catch (DbException e) {
|
||||
logException(LOG, WARNING, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user