From 35dfd13c962d5f9d51063cfece2eeb040f827346 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Mon, 9 Jan 2023 15:48:56 +0100 Subject: [PATCH] fix(share-menu): Fixes URL for shared status when using suare.and.arrow.up share menu on status --- Mastodon/Protocol/Provider/DataSourceFacade+Status.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mastodon/Protocol/Provider/DataSourceFacade+Status.swift b/Mastodon/Protocol/Provider/DataSourceFacade+Status.swift index 90b5b184e..5872fe5b5 100644 --- a/Mastodon/Protocol/Provider/DataSourceFacade+Status.swift +++ b/Mastodon/Protocol/Provider/DataSourceFacade+Status.swift @@ -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 = 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