diff --git a/index.html b/index.html index 81ecb69..5fa196f 100644 --- a/index.html +++ b/index.html @@ -198,13 +198,6 @@

Steam guard for account td_ban.innerHTML = ban; let td_action = document.createElement('td'); td_action.className = "actions"; - let a_copy_code = document.createElement('a'); - a_copy_code.className = "btn-floating btn-small red"; - a_copy_code.innerHTML = 'code'; - a_copy_code.addEventListener('click', async e => { - clipboard.writeText(friendCode.encode(account.steamid), 'selection'); - M.toast({html: 'Copied!', classes: 'green'}); - }); let a_copy = document.createElement('a'); a_copy.className = "btn-floating btn-small red"; a_copy.innerHTML = 'password'; @@ -238,7 +231,6 @@

Steam guard for account document.querySelector('.delete-btn').focus(); } }); - td_action.appendChild(a_copy_code); td_action.appendChild(a_copy); td_action.appendChild(a_refresh); td_action.appendChild(a_delete); @@ -278,7 +270,16 @@

Steam guard for account a_open_profile.addEventListener('click', async e => { shell.openExternal('https://steamcommunity.com/profiles/' + account.steamid); }); - tr.querySelector(".actions").appendChild(a_open_profile); + } + if(account.steamid && !tr.querySelector(".copy-code")) { + let a_copy_code = document.createElement('a'); + a_copy_code.className = "btn-floating btn-small red copy-code"; + a_copy_code.innerHTML = 'code'; + a_copy_code.addEventListener('click', async e => { + clipboard.writeText(friendCode.encode(account.steamid), 'selection'); + M.toast({html: 'Copied!', classes: 'green'}); + }); + tr.querySelector(".actions").prepend(a_copy_code); } } }