Add MainActor to main views in iOS

This commit is contained in:
Jackson Harper
2023-07-20 13:12:48 +08:00
parent 392c2e2032
commit 57894754a6
4 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,7 @@ struct AnimatingCellHeight: AnimatableModifier {
#if os(iOS)
private let enableGrid = UIDevice.isIPad || FeatureFlag.enableGridCardsOnPhone
@MainActor
struct HomeFeedContainerView: View {
@State var hasHighlightMutations = false
@State var searchPresented = false
@ -228,6 +229,7 @@ struct AnimatingCellHeight: AnimatableModifier {
}
}
@MainActor
struct HomeFeedView: View {
@EnvironmentObject var dataService: DataService
@Binding var prefersListLayout: Bool

View File

@ -2,6 +2,7 @@ import SwiftUI
import Utils
import Views
@MainActor
struct HomeView: View {
@State private var viewModel: HomeFeedViewModel

View File

@ -7,6 +7,7 @@ import Views
let appLogger = Logger(subsystem: "app.omnivore", category: "app-package")
@MainActor
public struct RootView: View {
@Environment(\.scenePhase) var scenePhase
@StateObject private var viewModel = RootViewModel()
@ -39,6 +40,7 @@ public struct RootView: View {
}
}
@MainActor
struct InnerRootView: View {
@EnvironmentObject var dataService: DataService
@EnvironmentObject var authenticator: Authenticator

View File

@ -4,6 +4,7 @@ import Utils
import Views
import WebKit
@MainActor
struct WebReader: PlatformViewRepresentable {
let item: LinkedItem
let articleContent: ArticleContent