Use shared instance var for app model

This commit is contained in:
Angelo Stavrow 2021-02-10 15:01:23 -05:00
parent 6cc2194b26
commit 3ccc9d68fd
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,8 @@ final class WriteFreelyModel: ObservableObject {
@Published var isPresentingSettingsView: Bool = false
#endif
static var shared = WriteFreelyModel()
var loginErrorMessage: String?
// swiftlint:disable line_length

View File

@ -22,7 +22,7 @@ struct CheckForDebugModifier {
}
struct WriteFreely_MultiPlatformApp: App {
@StateObject private var model = WriteFreelyModel()
@StateObject private var model = WriteFreelyModel.shared
#if os(macOS)
// swiftlint:disable:next weak_delegate