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(txn, groupId);
forumSharingManager.getSharedWith(groupId); Collection<ContactId> contactIds = new ArrayList<>(contacts.size());
Collection<ContactId> contactIds = for (Contact c : contacts) contactIds.add(c.getId());
new ArrayList<>(contacts.size()); txn.attach(() -> sharingController.addAll(contactIds));
for (Contact c : contacts) contactIds.add(c.getId()); }, e -> logException(LOG, WARNING, e));
sharingController.addAll(contactIds);
} catch (DbException e) {
logException(LOG, WARNING, e);
}
});
} }
void deleteForum() { void deleteForum() {