parent
bcac7fc375
commit
0273eab753
8 changed files with 127 additions and 8 deletions
|
|
@ -45,6 +45,7 @@ const el = {
|
|||
addGuildBtn: document.getElementById("add-guild-btn"),
|
||||
guildTitle: document.getElementById("guild-title"),
|
||||
createInviteBtn: document.getElementById("create-invite-btn"),
|
||||
inviteCopiedBadge: document.getElementById("invite-copied-badge"),
|
||||
|
||||
// Channels
|
||||
channelList: document.getElementById("channel-list"),
|
||||
|
|
@ -510,7 +511,7 @@ async function createInviteLink() {
|
|||
const link = `${location.origin}/?invite=${encodeURIComponent(invite.code)}`;
|
||||
try {
|
||||
await navigator.clipboard.writeText(link);
|
||||
alert(`Invite link copied:\n${link}`);
|
||||
showCopiedBadge();
|
||||
} catch {
|
||||
prompt("Copy invite link:", link);
|
||||
}
|
||||
|
|
@ -519,6 +520,13 @@ async function createInviteLink() {
|
|||
}
|
||||
}
|
||||
|
||||
function showCopiedBadge() {
|
||||
el.inviteCopiedBadge.classList.remove("hidden");
|
||||
setTimeout(() => {
|
||||
el.inviteCopiedBadge.classList.add("hidden");
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// --- Logic ---
|
||||
|
||||
async function loadGuilds() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue