NetNewsWire/Multiplatform/Shared/Timeline/TimelineContainerView.swift

33 lines
702 B
Swift
Raw Normal View History

2020-06-30 18:03:33 +02:00
//
// TimelineContainerView.swift
// NetNewsWire
//
// Created by Maurice Parker on 6/30/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
2020-07-01 18:13:11 +02:00
import Account
2020-06-30 18:03:33 +02:00
struct TimelineContainerView: View {
2020-07-12 01:22:47 +02:00
@Environment(\.undoManager) var undoManager
2020-06-30 18:03:33 +02:00
@EnvironmentObject private var sceneModel: SceneModel
var feeds: [Feed]? = nil
2020-06-30 18:03:33 +02:00
@ViewBuilder var body: some View {
if let feeds = feeds {
2020-07-01 18:13:11 +02:00
TimelineView()
.modifier(TimelineToolbarModifier())
2020-07-12 01:22:47 +02:00
.environmentObject(sceneModel.timelineModel)
2020-07-01 18:13:11 +02:00
.onAppear {
2020-07-12 01:22:47 +02:00
sceneModel.timelineModel.undoManager = undoManager
2020-07-12 21:43:52 +02:00
sceneModel.timelineModel.fetchArticles(feeds: feeds)
2020-07-01 18:13:11 +02:00
}
} else {
EmptyView()
}
2020-06-30 18:03:33 +02:00
}
}