mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21: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))
|
StatusEditorView(mode: .quote(status: status))
|
||||||
case let .replyToStatusEditor(status):
|
case let .replyToStatusEditor(status):
|
||||||
StatusEditorView(mode: .replyTo(status: status))
|
StatusEditorView(mode: .replyTo(status: status))
|
||||||
|
case let .mentionStatusEditor(account, visibility):
|
||||||
|
StatusEditorView(mode: .mention(account: account, visibility: visibility))
|
||||||
case .none:
|
case .none:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import SwiftUI
|
||||||
public struct AccountDetailView: View {
|
public struct AccountDetailView: View {
|
||||||
@Environment(\.openURL) private var openURL
|
@Environment(\.openURL) private var openURL
|
||||||
@Environment(\.redactionReasons) private var reasons
|
@Environment(\.redactionReasons) private var reasons
|
||||||
|
@Environment(\.openWindow) private var openWindow
|
||||||
|
|
||||||
@Environment(StreamWatcher.self) private var watcher
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
|
@ -329,8 +330,13 @@ public struct AccountDetailView: View {
|
||||||
if !viewModel.isCurrentUser {
|
if !viewModel.isCurrentUser {
|
||||||
Button {
|
Button {
|
||||||
if let account = viewModel.account {
|
if let account = viewModel.account {
|
||||||
routerPath.presentedSheet = .mentionStatusEditor(account: account,
|
#if targetEnvironment(macCatalyst)
|
||||||
visibility: preferences.postVisibility)
|
openWindow(value: WindowDestinationEditor.mentionStatusEditor(account: account, visibility: preferences.postVisibility))
|
||||||
|
#else
|
||||||
|
routerPath.presentedSheet = .mentionStatusEditor(account: account,
|
||||||
|
visibility: preferences.postVisibility)
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "arrowshape.turn.up.left")
|
Image(systemName: "arrowshape.turn.up.left")
|
||||||
|
|
|
@ -30,6 +30,7 @@ public enum WindowDestinationEditor: Hashable, Codable {
|
||||||
case editStatusEditor(status: Status)
|
case editStatusEditor(status: Status)
|
||||||
case replyToStatusEditor(status: Status)
|
case replyToStatusEditor(status: Status)
|
||||||
case quoteStatusEditor(status: Status)
|
case quoteStatusEditor(status: Status)
|
||||||
|
case mentionStatusEditor(account: Account, visibility: Models.Visibility)
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WindowDestinationMedia: Hashable, Codable {
|
public enum WindowDestinationMedia: Hashable, Codable {
|
||||||
|
|
Loading…
Reference in a new issue