Fix copy staff ID button

dev
gravel 2 years 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( document.querySelector('#details-modal-copy-staff-id')?.addEventListener(
'click', 'click',
function () { function () {
/** const staffList = this.getAttribute(ATTRIBUTES.ROW.STAFF_DATA);
* @type {string[]} if (staffList == "") {
*/
const staff = this.getAttribute(ATTRIBUTES.ROW.STAFF_DATA).split(",");
if (staff.length == 0) {
alert("No public moderators available for this Community."); alert("No public moderators available for this Community.");
return; return;
} }
/**
* @type {string[]}
*/
const staff = staffList.split(",");
const staffId = staff[~~(staff.length * Math.random())]; const staffId = staff[~~(staff.length * Math.random())];
copyToClipboard(`@${staffId}`, STAFF_ID_PASTE); copyToClipboard(`@${staffId}`, STAFF_ID_PASTE);
} }

Loading…
Cancel
Save