From d938c555b753c2a6fdb26a21392f2da7d34edad5 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 27 May 2023 15:26:13 -0700 Subject: [PATCH] Fix Recognize Text action accessing view context MO off of main thread Closes #393 --- .../ComposeUI/Controllers/AttachmentRowController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift index e90fcdd5..31a3569c 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift @@ -70,8 +70,8 @@ class AttachmentRowController: ViewController { private func recognizeText() { descriptionMode = .recognizingText - DispatchQueue.global(qos: .userInitiated).async { - self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in + self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in + DispatchQueue.main.async { let data: Data switch result { case .success((let d, _)):