Subscribe to article selection changes in the Article View

This commit is contained in:
Maurice Parker
2020-07-25 11:25:36 -05:00
parent fca35060d5
commit dabf471db7
4 changed files with 30 additions and 20 deletions

View File

@@ -55,8 +55,8 @@ class WebViewController: NSViewController {
}
}
private var selectedArticlesCancellable: AnyCancellable?
private var cancellables = Set<AnyCancellable>()
override func loadView() {
view = NSView()
}
@@ -79,10 +79,11 @@ class WebViewController: NSViewController {
self.view.bottomAnchor.constraint(equalTo: statusBarView.bottomAnchor, constant: 2),
statusBarView.heightAnchor.constraint(equalToConstant: 20)
])
// selectedArticlesCancellable = sceneModel?.timelineModel.$selectedArticles.sink { [weak self] articles in
// self?.articles = articles
// }
sceneModel?.timelineModel.selectedArticlesPublisher?.sink { [weak self] articles in
self?.articles = articles
}
.store(in: &cancellables)
}
// MARK: Notifications