From bd8b7c6ed9b93a2262ee866b065c09dd9f10a2b4 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 25 Nov 2017 11:13:15 -0800 Subject: [PATCH] Implement debugDropConditionalGetInfo command. Fix #197. --- Frameworks/Account/Account.swift | 9 +++++++++ Frameworks/Data/Feed.swift | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 9a6ab0645..58ac490c6 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -352,6 +352,15 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, flattenedFeeds().forEach { $0.unreadCount = 0 } } + // MARK: - Debug + + public func debugDropConditionalGetInfo() { + + #if DEBUG + flattenedFeeds().forEach{ $0.debugDropConditionalGetInfo() } + #endif + } + // MARK: - Notifications @objc func downloadProgressDidChange(_ note: Notification) { diff --git a/Frameworks/Data/Feed.swift b/Frameworks/Data/Feed.swift index 8371e5937..ae344858f 100644 --- a/Frameworks/Data/Feed.swift +++ b/Frameworks/Data/Feed.swift @@ -136,6 +136,16 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { } } + // MARK: - Debug + + public func debugDropConditionalGetInfo() { + + conditionalGetInfo = nil + contentHash = nil + } + + // MARK: - Equatable + public class func ==(lhs: Feed, rhs: Feed) -> Bool { return lhs === rhs