fix: tui: Handle Clipboard.copy errors properly (#3685)

This commit is contained in:
Haris Gušić
2025-11-01 15:34:21 +01:00
committed by GitHub
parent 7df61a74a0
commit 55787f2caa
3 changed files with 17 additions and 4 deletions

View File

@@ -296,8 +296,9 @@ function App() {
/* @ts-expect-error */
renderer.writeOut(finalOsc52)
await Clipboard.copy(text)
.then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
.catch(toast.error)
renderer.clearSelection()
toast.show({ message: "Copied to clipboard", variant: "info" })
}
}}
>