Fix DraftAttachment being accessed off main thread
This commit is contained in:
parent
bff1ea8b9d
commit
2249e5a315
|
@ -10,6 +10,7 @@ import Foundation
|
|||
import Pachyderm
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
@MainActor
|
||||
class PostService: ObservableObject {
|
||||
private let mastodonController: ComposeMastodonContext
|
||||
private let config: ComposeUIConfig
|
||||
|
@ -26,7 +27,6 @@ class PostService: ObservableObject {
|
|||
self.totalSteps = 2 + (draft.attachments.count * 2)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func post() async throws {
|
||||
guard draft.hasContent else {
|
||||
return
|
||||
|
@ -65,7 +65,6 @@ class PostService: ObservableObject {
|
|||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func uploadAttachments() async throws -> [Attachment] {
|
||||
var attachments: [Attachment] = []
|
||||
attachments.reserveCapacity(draft.attachments.count)
|
||||
|
|
Loading…
Reference in New Issue