mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 10:11:00 +00:00
Catalyst: Fix mention window
This commit is contained in:
parent
75a61cb534
commit
ad4995ad70
3 changed files with 11 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue