diff --git a/Frameworks/Account/Folder.swift b/Frameworks/Account/Folder.swift index 85d411b06..33928ea0a 100644 --- a/Frameworks/Account/Folder.swift +++ b/Frameworks/Account/Folder.swift @@ -58,6 +58,7 @@ public final class Folder: DisplayNameProvider, Container, UnreadCountProvider, self.hashValue = folderID NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(childrenDidChange(_:)), name: .ChildrenDidChange, object: self) } // MARK: - Disk Dictionary @@ -130,7 +131,7 @@ public final class Folder: DisplayNameProvider, Container, UnreadCountProvider, return true } - // MARK: Notifications + // MARK: - Notifications @objc func unreadCountDidChange(_ note: Notification) { @@ -141,6 +142,11 @@ public final class Folder: DisplayNameProvider, Container, UnreadCountProvider, } } + @objc func childrenDidChange(_ note: Notification) { + + updateUnreadCount() + } + // MARK: - Equatable static public func ==(lhs: Folder, rhs: Folder) -> Bool {