Use commit action to add contacts on UI thread.

This commit is contained in:
akwizgran
2021-01-27 15:34:42 +00:00
committed by Torsten Grote
parent d69406dfe3
commit 70532732c8

View File

@@ -205,18 +205,13 @@ class ForumViewModel extends ThreadListViewModel<ForumPostItem> {
} }
public void loadSharingContacts() { public void loadSharingContacts() {
runOnDbThread(() -> { runOnDbThread(true, txn -> {
try {
Collection<Contact> contacts = Collection<Contact> contacts =
forumSharingManager.getSharedWith(groupId); forumSharingManager.getSharedWith(txn, groupId);
Collection<ContactId> contactIds = Collection<ContactId> contactIds = new ArrayList<>(contacts.size());
new ArrayList<>(contacts.size());
for (Contact c : contacts) contactIds.add(c.getId()); for (Contact c : contacts) contactIds.add(c.getId());
sharingController.addAll(contactIds); txn.attach(() -> sharingController.addAll(contactIds));
} catch (DbException e) { }, e -> logException(LOG, WARNING, e));
logException(LOG, WARNING, e);
}
});
} }
void deleteForum() { void deleteForum() {