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