diff --git a/src/statistics/recommender/custom-improvements.js b/src/statistics/recommender/custom-improvements.js index 44734a7..8235f8e 100644 --- a/src/statistics/recommender/custom-improvements.js +++ b/src/statistics/recommender/custom-improvements.js @@ -218,7 +218,20 @@ class IntentImprovement extends LitElement { copyToClipboard() { const resDiv = this.shadowRoot.querySelector("#chatgptRes"); - navigator.clipboard.writeText(resDiv.innerText); + const clipBoardBtn = this.shadowRoot.querySelector( + "#copyToClipboardButton" + ); + try { + navigator.clipboard.writeText(resDiv.innerText); + clipBoardBtn.classList.remove("btn-outline-secondary"); + clipBoardBtn.classList.add("btn-success"); + setTimeout(() => { + clipBoardBtn.classList.remove("btn-success"); + clipBoardBtn.classList.add("btn-outline-secondary"); + }, 1000); + } catch (error) { + console.error(error); + } } } diff --git a/src/statistics/recommender/general-improvements.js b/src/statistics/recommender/general-improvements.js index 3c36fc3..a041162 100644 --- a/src/statistics/recommender/general-improvements.js +++ b/src/statistics/recommender/general-improvements.js @@ -56,6 +56,7 @@ class GeneralImprovement extends LitElement {