Fix the iPad which seems to like to set the selected value to nil after setting it to the correct selection

This commit is contained in:
Maurice Parker 2020-07-18 21:02:38 -05:00
parent 9240c8e8a9
commit 8291230561
2 changed files with 4 additions and 4 deletions

View File

@ -91,11 +91,11 @@ private extension SidebarModel {
} }
.assign(to: $selectedFeeds) .assign(to: $selectedFeeds)
$selectedFeedIdentifier.map { [weak self] feedID in $selectedFeedIdentifier.compactMap { [weak self] feedID in
if let feedID = feedID, let feed = self?.findFeed(feedID) { if let feedID = feedID, let feed = self?.findFeed(feedID) {
return [feed] return [feed]
} else { } else {
return [Feed]() return nil
} }
} }
.assign(to: $selectedFeeds) .assign(to: $selectedFeeds)

View File

@ -131,11 +131,11 @@ class TimelineModel: ObservableObject, UndoableCommandRunner {
} }
.assign(to: $selectedArticles) .assign(to: $selectedArticles)
$selectedArticleID.map { [weak self] articleID in $selectedArticleID.compactMap { [weak self] articleID in
if let articleID = articleID, let article = self?.idToArticleDictionary[articleID] { if let articleID = articleID, let article = self?.idToArticleDictionary[articleID] {
return [article] return [article]
} else { } else {
return [Article]() return nil
} }
} }
.assign(to: $selectedArticles) .assign(to: $selectedArticles)