diff --git a/IceCubesApp/App/Main/IceCubesApp+Scene.swift b/IceCubesApp/App/Main/IceCubesApp+Scene.swift index c036c1ab..6e6465bf 100644 --- a/IceCubesApp/App/Main/IceCubesApp+Scene.swift +++ b/IceCubesApp/App/Main/IceCubesApp+Scene.swift @@ -76,6 +76,8 @@ extension IceCubesApp { StatusEditorView(mode: .quote(status: status)) case let .replyToStatusEditor(status): StatusEditorView(mode: .replyTo(status: status)) + case let .mentionStatusEditor(account, visibility): + StatusEditorView(mode: .mention(account: account, visibility: visibility)) case .none: EmptyView() } diff --git a/Packages/Account/Sources/Account/AccountDetailView.swift b/Packages/Account/Sources/Account/AccountDetailView.swift index ca204b52..b88123f8 100644 --- a/Packages/Account/Sources/Account/AccountDetailView.swift +++ b/Packages/Account/Sources/Account/AccountDetailView.swift @@ -11,6 +11,7 @@ import SwiftUI public struct AccountDetailView: View { @Environment(\.openURL) private var openURL @Environment(\.redactionReasons) private var reasons + @Environment(\.openWindow) private var openWindow @Environment(StreamWatcher.self) private var watcher @Environment(CurrentAccount.self) private var currentAccount @@ -329,8 +330,13 @@ public struct AccountDetailView: View { if !viewModel.isCurrentUser { Button { if let account = viewModel.account { - routerPath.presentedSheet = .mentionStatusEditor(account: account, - visibility: preferences.postVisibility) + #if targetEnvironment(macCatalyst) + openWindow(value: WindowDestinationEditor.mentionStatusEditor(account: account, visibility: preferences.postVisibility)) + #else + routerPath.presentedSheet = .mentionStatusEditor(account: account, + visibility: preferences.postVisibility) + #endif + } } label: { Image(systemName: "arrowshape.turn.up.left") diff --git a/Packages/Env/Sources/Env/Router.swift b/Packages/Env/Sources/Env/Router.swift index d87d9395..ceba64f2 100644 --- a/Packages/Env/Sources/Env/Router.swift +++ b/Packages/Env/Sources/Env/Router.swift @@ -30,6 +30,7 @@ public enum WindowDestinationEditor: Hashable, Codable { case editStatusEditor(status: Status) case replyToStatusEditor(status: Status) case quoteStatusEditor(status: Status) + case mentionStatusEditor(account: Account, visibility: Models.Visibility) } public enum WindowDestinationMedia: Hashable, Codable {