Fix COPY button on API Keys page
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 <noreply@anthropic.com>
This commit is contained in:
@@ -175,8 +175,9 @@ document.getElementById('generateKeyForm').addEventListener('submit', function (
|
|||||||
|
|
||||||
function copyApiKey() {
|
function copyApiKey() {
|
||||||
var val = document.getElementById('newKeyValue').value;
|
var val = document.getElementById('newKeyValue').value;
|
||||||
lt.copy(val).then(function () {
|
lt.clipboard.copy(val).then(function (ok) {
|
||||||
lt.toast.success('Copied to clipboard!');
|
if (ok) lt.toast.success('Copied to clipboard!');
|
||||||
|
else lt.toast.error('Copy failed — select the key manually');
|
||||||
}).catch(function () {
|
}).catch(function () {
|
||||||
lt.toast.error('Copy failed — select the key manually');
|
lt.toast.error('Copy failed — select the key manually');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user