Update settings.js

Fixed a bug in copying the URL
This commit is contained in:
Rodrigo Emanuel
2025-05-14 18:06:33 -03:00
committed by GitHub
parent e103df9e3f
commit 824cbf5c96

View File

@@ -194,27 +194,30 @@ async function generateUrl() {
async function copyUrl() {
const output = document.getElementById("outputUrl");
output.select();
document.execCommand("copy");
const output = document.getElementById("outputUrl")
const value = output.value;
const button = document.querySelector('.url-bar button');
const buttonDefaulText = 'Copy URL';
button.textContent = 'ChatRD URL Copied!';
button.style.backgroundColor = "#00dd63";
navigator.clipboard.writeText(value)
.then(() => {
setTimeout(() => {
button.textContent = buttonDefaulText;
button.removeAttribute('style');
}, 3000);
button.textContent = 'ChatRD URL Copied!';
button.style.backgroundColor = "#00dd63";
setTimeout(() => {
button.textContent = buttonDefaulText;
button.removeAttribute('style');
}, 3000);
})
.catch(err => {
console.error("Failed to copy: ", err);
});
}
async function setupAddEmoteModal() {
const modal = document.getElementById("addEmoteModal");
const nameInput = document.getElementById("newEmoteName");