TF-4141 Add the AI needs-action option into the user settings.

This commit is contained in:
dab246
2025-12-23 01:13:17 +07:00
committed by Dat H. Pham
parent cb0471ecb7
commit 1661210e04
19 changed files with 171 additions and 35 deletions
@@ -42,4 +42,24 @@ extension HandleActionRequiredTabExtension on BaseMailboxController {
bool _allMailboxesContains(MailboxId id) {
return allMailboxes.any((mailbox) => mailbox.id == id);
}
void removeActionRequiredFolder() {
final folder = PresentationMailbox.actionRequiredFolder;
_removeFromDefaultMailboxTree(folder.id);
_removeFromAllMailboxes(folder.id);
}
void _removeFromDefaultMailboxTree(MailboxId folderId) {
final root = defaultMailboxTree.value.root;
final children = List<MailboxNode>.from(root.childrenItems ?? [])
..removeWhere((node) => node.item.id == folderId);
defaultMailboxTree.value = MailboxTree(
root.copyWith(children: children),
);
}
void _removeFromAllMailboxes(MailboxId folderId) {
allMailboxes.removeWhere((mailbox) => mailbox.id == folderId);
}
}