fix(share-menu): Fixes URL for shared status when using suare.and.arrow.up share menu on status

This commit is contained in:
Marcus Kida 2023-01-09 15:48:56 +01:00
parent 7041a81fcf
commit 35dfd13c96
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 7 additions and 1 deletions

View File

@ -312,10 +312,16 @@ extension DataSourceFacade {
} // end Task
case .shareStatus:
Task {
guard let status = menuContext.status else {
let managedObjectContext = dependency.context.managedObjectContext
guard let status: ManagedObjectRecord<Status> = try? await managedObjectContext.perform(block: {
guard let object = menuContext.status?.object(in: managedObjectContext) else { return nil }
let objectID = (object.reblog ?? object).objectID
return .init(objectID: objectID)
}) else {
assertionFailure()
return
}
let activityViewController = try await DataSourceFacade.createActivityViewController(
dependency: dependency,
status: status