mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-07 14:28:50 +00:00
DM reply now open on a window on macOS
This commit is contained in:
parent
60ade66251
commit
9ec9c94c9a
1 changed files with 15 additions and 2 deletions
|
@ -6,6 +6,8 @@ import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
struct ConversationsListRow: View {
|
struct ConversationsListRow: View {
|
||||||
|
@Environment(\.openWindow) private var openWindow
|
||||||
|
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
@ -81,7 +83,11 @@ struct ConversationsListRow: View {
|
||||||
.accessibilityAction(.magicTap) {
|
.accessibilityAction(.magicTap) {
|
||||||
if let lastStatus = conversation.lastStatus {
|
if let lastStatus = conversation.lastStatus {
|
||||||
HapticManager.shared.fireHaptic(.notification(.success))
|
HapticManager.shared.fireHaptic(.notification(.success))
|
||||||
routerPath.presentedSheet = .replyToStatusEditor(status: lastStatus)
|
#if targetEnvironment(macCatalyst)
|
||||||
|
openWindow(value: WindowDestinationEditor.replyToStatusEditor(status: lastStatus))
|
||||||
|
#else
|
||||||
|
routerPath.presentedSheet = .replyToStatusEditor(status: lastStatus)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +98,14 @@ struct ConversationsListRow: View {
|
||||||
private var actionsView: some View {
|
private var actionsView: some View {
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
Button {
|
Button {
|
||||||
routerPath.presentedSheet = .replyToStatusEditor(status: conversation.lastStatus!)
|
if let lastStatus = conversation.lastStatus {
|
||||||
|
HapticManager.shared.fireHaptic(.notification(.success))
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
openWindow(value: WindowDestinationEditor.replyToStatusEditor(status: lastStatus))
|
||||||
|
#else
|
||||||
|
routerPath.presentedSheet = .replyToStatusEditor(status: lastStatus)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "arrowshape.turn.up.left.fill")
|
Image(systemName: "arrowshape.turn.up.left.fill")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue