Add delete and archive rule actions

This commit is contained in:
Jordan Wages 2025-07-15 22:38:53 -05:00
commit fa62afa50e
4 changed files with 16 additions and 5 deletions

View file

@ -171,7 +171,7 @@ document.addEventListener('DOMContentLoaded', async () => {
const typeWrapper = document.createElement('div');
typeWrapper.className = 'select is-small mr-2';
const typeSelect = document.createElement('select');
['tag','move','copy','junk','read','flag'].forEach(t => {
['tag','move','copy','junk','read','flag','delete','archive'].forEach(t => {
const opt = document.createElement('option');
opt.value = t;
opt.textContent = t;
@ -242,6 +242,8 @@ document.addEventListener('DOMContentLoaded', async () => {
sel.value = String(action.flagged ?? true);
wrap.appendChild(sel);
paramSpan.appendChild(wrap);
} else if (typeSelect.value === 'delete' || typeSelect.value === 'archive') {
paramSpan.appendChild(document.createElement('span'));
}
}
@ -373,6 +375,9 @@ document.addEventListener('DOMContentLoaded', async () => {
if (type === 'flag') {
return { type, flagged: row.querySelector('.flag-select').value === 'true' };
}
if (type === 'delete' || type === 'archive') {
return { type };
}
return { type };
});
const stopProcessing = ruleEl.querySelector('.stop-processing')?.checked;