From badaba52409fb45f0bfb5d53189d584d87c4a9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Jim=C3=A9nez?= Date: Tue, 30 Aug 2022 02:36:25 +0200 Subject: [PATCH] fix: clipboard issues (#579) fix #447 --- app/main/components/Cerebro/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/main/components/Cerebro/index.js b/app/main/components/Cerebro/index.js index 849be675..129629f5 100644 --- a/app/main/components/Cerebro/index.js +++ b/app/main/components/Cerebro/index.js @@ -182,10 +182,13 @@ class Cerebro extends Component { if (event.metaKey || event.ctrlKey) { if (event.keyCode === 67) { // Copy to clipboard on cmd+c - const text = this.highlightedResult().clipboard + const text = this.highlightedResult()?.clipboard || this.props.term if (text) { clipboard.writeText(text) this.props.actions.reset() + if (!event.defaultPrevented) { + this.electronWindow.hide() + } event.preventDefault() } return