From afa1958ac54060fe1ee6766ac56246c846025fa2 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Fri, 28 Aug 2026 15:17:52 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20mes?= =?UTF-8?q?sage.text->meesage.body=20#13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shared/UI/Components/MessageBubble.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Sources/Shared/UI/Components/MessageBubble.swift b/Sources/Shared/UI/Components/MessageBubble.swift index 0d2dd17..1625cc6 100644 --- a/Sources/Shared/UI/Components/MessageBubble.swift +++ b/Sources/Shared/UI/Components/MessageBubble.swift @@ -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 {