Hide only the filtered-out button in a row, not the entire row

This commit is contained in:
cmdr2 2023-03-15 21:20:56 +05:30
parent b7a7a7d31f
commit 6298df14e7

View File

@ -401,7 +401,8 @@ function showImages(reqBody, res, outputContainer, livePreview) {
}
buttons.forEach(btn => {
if (Array.isArray(btn)) {
if (btn.find(btnInfo => btnInfo.filter && btnInfo.filter(req, img) === false)) {
btn = btn.filter(btnInfo => !btnInfo.filter || btnInfo.filter(req, img) === true)
if (btn.length === 0) {
return
}
} else if (btn.filter && btn.filter(req, img) === false) {