Skip to content

Commit 5539e1f

Browse files
authored
Fix Copy for No Data (#61)
1 parent cacaa09 commit 5539e1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/js/options.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ async function copyInput(event) {
303303
console.debug('element.dataset.copyInput:', element.dataset.copyInput)
304304
const input = document.querySelector(element.dataset.copyInput)
305305
console.debug('input:', input)
306+
if (!input.value) {
307+
showToast('No Data to Copy.', 'warning')
308+
return
309+
}
306310
await navigator.clipboard.writeText(input.value)
307311
if (element.dataset.copyText) {
308312
showToast(element.dataset.copyText)

0 commit comments

Comments
 (0)