fix remove/approve buttons not working from listing page

This commit is contained in:
justcool393 2023-07-28 12:09:16 -05:00
parent eb78ec6169
commit 062e7328b1
3 changed files with 4 additions and 1 deletions

View file

@ -1,23 +0,0 @@
function moderate(isPost, id, removing, removeButtonDesktopId, removeButtonMobileId, approveButtonDesktopId, approveButtonMobileId) {
const filterState = removing ? "removed" : "normal";
if (isPost) {
filter_new_status(id, filterState);
} else {
filter_new_comment_status(id, filterState);
}
const removeButtonDesktop = document.getElementById(removeButtonDesktopId);
const removeButtonMobile = document.getElementById(removeButtonMobileId);
const approveButtonDesktop = document.getElementById(approveButtonDesktopId);
const approveButtonMobile = document.getElementById(approveButtonMobileId);
if (removing) {
removeButtonDesktop.classList.add("d-none");
removeButtonMobile.classList.add("d-none");
approveButtonDesktop.classList.remove("d-none");
approveButtonMobile.classList.remove("d-none");
} else {
removeButtonDesktop.classList.remove("d-none");
removeButtonMobile.classList.remove("d-none");
approveButtonDesktop.classList.add("d-none");
approveButtonMobile.classList.add("d-none");
}
}