Fix copy staff ID button

dev
gravel 1 year ago
parent fa59552fb4
commit 1548c6e5d3
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -327,14 +327,15 @@ function addQRModalHandlers() {
document.querySelector('#details-modal-copy-staff-id')?.addEventListener(
'click',
function () {
/**
* @type {string[]}
*/
const staff = this.getAttribute(ATTRIBUTES.ROW.STAFF_DATA).split(",");
if (staff.length == 0) {
const staffList = this.getAttribute(ATTRIBUTES.ROW.STAFF_DATA);
if (staffList == "") {
alert("No public moderators available for this Community.");
return;
}
/**
* @type {string[]}
*/
const staff = staffList.split(",");
const staffId = staff[~~(staff.length * Math.random())];
copyToClipboard(`@${staffId}`, STAFF_ID_PASTE);
}

Loading…
Cancel
Save