From 4d622557f9b652e983b34e928f52fae381ef6988 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 1 Feb 2022 16:01:49 -0800 Subject: [PATCH] Add the isSyncingPaused property to WebFeed --- Account/Sources/Account/WebFeed.swift | 9 +++++++++ Account/Sources/Account/WebFeedMetadata.swift | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Account/Sources/Account/WebFeed.swift b/Account/Sources/Account/WebFeed.swift index d3a2604fe..cd10c3478 100644 --- a/Account/Sources/Account/WebFeed.swift +++ b/Account/Sources/Account/WebFeed.swift @@ -192,6 +192,15 @@ public final class WebFeed: Feed, Renamable, Hashable { } } + public var isSyncingPaused: Bool { + get { + return metadata.isSyncingPaused ?? false + } + set { + metadata.isSyncingPaused = newValue + } + } + // MARK: - DisplayNameProvider public var nameForDisplay: String { diff --git a/Account/Sources/Account/WebFeedMetadata.swift b/Account/Sources/Account/WebFeedMetadata.swift index aa381709f..66fab6663 100644 --- a/Account/Sources/Account/WebFeedMetadata.swift +++ b/Account/Sources/Account/WebFeedMetadata.swift @@ -30,6 +30,7 @@ final class WebFeedMetadata: Codable { case sinceToken case externalID = "subscriptionID" case folderRelationship + case isSyncingPaused } var webFeedID: String { @@ -136,6 +137,14 @@ final class WebFeedMetadata: Codable { } } } + + var isSyncingPaused: Bool? { + didSet { + if isSyncingPaused != oldValue { + valueDidChange(.isSyncingPaused) + } + } + } weak var delegate: WebFeedMetadataDelegate?