From 2d02d9b472bb619534e2310dfd6c18cce024c49f Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 22 Apr 2023 22:13:59 +0200 Subject: [PATCH] Fix possible crashes --- Model/Watch.swift | 2 +- Shared/YatteeApp.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Watch.swift b/Model/Watch.swift index 539ad071..8773c065 100644 --- a/Model/Watch.swift +++ b/Model/Watch.swift @@ -51,7 +51,7 @@ extension Watch { @NSManaged var appName: String? @NSManaged var instanceURL: URL? - var app: VideosApp! { + var app: VideosApp? { guard let appName else { return nil } return .init(rawValue: appName) } diff --git a/Shared/YatteeApp.swift b/Shared/YatteeApp.swift index bac91e68..43b5ccfc 100644 --- a/Shared/YatteeApp.swift +++ b/Shared/YatteeApp.swift @@ -32,9 +32,11 @@ struct YatteeApp: App { @State private var configured = false + @StateObject private var accounts = AccountsModel.shared @StateObject private var comments = CommentsModel.shared @StateObject private var instances = InstancesModel.shared @StateObject private var menu = MenuModel.shared + @StateObject private var navigation = NavigationModel.shared @StateObject private var networkState = NetworkStateModel.shared @StateObject private var player = PlayerModel.shared @StateObject private var playlists = PlaylistsModel.shared