Skip to content

Commit

Permalink
Fix Copy for No Data (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr authored Jul 12, 2024
1 parent cacaa09 commit 5539e1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ async function copyInput(event) {
console.debug('element.dataset.copyInput:', element.dataset.copyInput)
const input = document.querySelector(element.dataset.copyInput)
console.debug('input:', input)
if (!input.value) {
showToast('No Data to Copy.', 'warning')
return
}
await navigator.clipboard.writeText(input.value)
if (element.dataset.copyText) {
showToast(element.dataset.copyText)
Expand Down

0 comments on commit 5539e1f

Please sign in to comment.