mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:02 -04:00
Hide copy to clipboard button if browser API is not available
This commit is contained in:
@@ -508,6 +508,7 @@
|
||||
spinnerCreate.style.display = '';
|
||||
});
|
||||
shareButtons.forEach((el) => {
|
||||
if(typeof navigator.clipboard !== 'undefined') {
|
||||
el.addEventListener('click', async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(el.dataset.code);
|
||||
@@ -520,6 +521,9 @@
|
||||
console.error(error.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
el.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
removeButtons.forEach((el) => {
|
||||
el.addEventListener('click', async () => {
|
||||
|
||||
Reference in New Issue
Block a user