Fix non-ui-thread modification in when editing poll (IOS-203)

This commit is contained in:
Marcus Kida 2023-12-04 14:31:38 +01:00
parent 7323cb9d08
commit 0f3c50ba8a
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
2 changed files with 2 additions and 4 deletions

View File

@ -109,9 +109,7 @@ extension StatusSection {
tableView: UITableView,
indexPath: IndexPath,
configuration: ThreadCellRegistrationConfiguration
) -> UITableViewCell {
let managedObjectContext = context.managedObjectContext
) -> UITableViewCell {
switch configuration.thread {
case .root(let threadContext):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusThreadRootTableViewCell.self), for: indexPath) as! StatusThreadRootTableViewCell

View File

@ -283,7 +283,7 @@ public final class ComposeContentViewModel: NSObject, ObservableObject {
isContentWarningActive = true
contentWarning = status.entity.spoilerText ?? ""
}
Task {
Task { @MainActor in
if let poll = await status.getPoll(in: context.managedObjectContext, domain: authContext.mastodonAuthenticationBox.domain) {
isPollActive = !poll.expired
pollMultipleConfigurationOption = poll.multiple