From afac0f8f917f694f522ee809a312c00103d010bc Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 16 Jan 2025 16:36:25 +0100 Subject: [PATCH] Change copyAllCodes to async function --- ui/create-election.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/create-election.html b/ui/create-election.html index 94403c0..b856b67 100644 --- a/ui/create-election.html +++ b/ui/create-election.html @@ -195,11 +195,10 @@ }); }, - copyAllCodes() { + async copyAllCodes() { const allCodes = this.voterIdentities.join("\n"); - navigator.clipboard.writeText(allCodes).then(() => { - alert("All codes copied to clipboard!"); - }).catch(err => { + await navigator.clipboard.writeText(allCodes) + .catch(err => { console.error("Failed to copy all codes: ", err); }); }