исправлена ошибка message.text->meesage.body #13
This commit is contained in:
@@ -72,14 +72,7 @@ struct MessageBubble: View {
|
||||
}
|
||||
}
|
||||
if message.hasText {
|
||||
Button(action: {
|
||||
#if os(macOS)
|
||||
NSPasteboard.general.clearContents()
|
||||
NSPasteboard.general.setString(message.text, forType: .string)
|
||||
#else
|
||||
UIPasteboard.general.string = message.text
|
||||
#endif
|
||||
}) {
|
||||
Button(action: copyText(message.body)) {
|
||||
Label("Копировать текст", systemImage: "doc.on.doc")
|
||||
}
|
||||
}
|
||||
@@ -117,6 +110,15 @@ struct MessageBubble: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func copyText(body: String) {
|
||||
#if os(macOS)
|
||||
NSPasteboard.general.clearContents()
|
||||
NSPasteboard.general.setString(message.body, forType: .string)
|
||||
#else
|
||||
UIPasteboard.general.string = message.body
|
||||
#endif
|
||||
}
|
||||
|
||||
private var messageContainer: some View {
|
||||
HStack(spacing: 2) {
|
||||
if isSelectionMode {
|
||||
|
||||
Reference in New Issue
Block a user