From f42ee8070f252363c0fe65c5037e5562d8bbf966 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 12 Apr 2026 00:03:37 -0400 Subject: [PATCH] Fix COPY button on API Keys page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lt.copy() does not exist — the correct API is lt.clipboard.copy(). Also added ok-check since clipboardCopy() returns a boolean promise, not a rejection on failure. Co-Authored-By: Claude Sonnet 4.6 --- views/admin/ApiKeysView.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/views/admin/ApiKeysView.php b/views/admin/ApiKeysView.php index e1aecc1..f67f4d0 100644 --- a/views/admin/ApiKeysView.php +++ b/views/admin/ApiKeysView.php @@ -175,8 +175,9 @@ document.getElementById('generateKeyForm').addEventListener('submit', function ( function copyApiKey() { var val = document.getElementById('newKeyValue').value; - lt.copy(val).then(function () { - lt.toast.success('Copied to clipboard!'); + lt.clipboard.copy(val).then(function (ok) { + if (ok) lt.toast.success('Copied to clipboard!'); + else lt.toast.error('Copy failed — select the key manually'); }).catch(function () { lt.toast.error('Copy failed — select the key manually'); });