diff --git a/assets/js/credits.js b/assets/js/credits.js index 031e3a51..5357cf7d 100644 --- a/assets/js/credits.js +++ b/assets/js/credits.js @@ -225,6 +225,20 @@ var codeEl = root.querySelector('[data-invite-code]'); var listEl = root.querySelector('[data-invite-list]'); var totalEl = root.querySelector('[data-invite-total]'); + var statusEl = root.querySelector('[data-invite-status]'); + var copyFeedback = root.querySelector('[data-invite-copy-feedback]'); + + function setStatus(text, isError) { + if (!statusEl) return; + statusEl.textContent = text; + statusEl.classList.toggle('is-error', !!isError); + } + + function setCopyFeedback(text, isError) { + if (!copyFeedback) return; + copyFeedback.textContent = text; + copyFeedback.classList.toggle('is-error', !!isError); + } function escapeHtml(value) { return String(value == null ? '' : value) @@ -268,7 +282,7 @@ else totalEl.textContent = total ? '共 ' + total + ' 条' : '暂无记录'; } if (!items.length) { - listEl.innerHTML = '