mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Use shared instance var for app model
This commit is contained in:
parent
6cc2194b26
commit
3ccc9d68fd
@ -24,6 +24,8 @@ final class WriteFreelyModel: ObservableObject {
|
|||||||
@Published var isPresentingSettingsView: Bool = false
|
@Published var isPresentingSettingsView: Bool = false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static var shared = WriteFreelyModel()
|
||||||
|
|
||||||
var loginErrorMessage: String?
|
var loginErrorMessage: String?
|
||||||
|
|
||||||
// swiftlint:disable line_length
|
// swiftlint:disable line_length
|
||||||
|
@ -22,7 +22,7 @@ struct CheckForDebugModifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct WriteFreely_MultiPlatformApp: App {
|
struct WriteFreely_MultiPlatformApp: App {
|
||||||
@StateObject private var model = WriteFreelyModel()
|
@StateObject private var model = WriteFreelyModel.shared
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
// swiftlint:disable:next weak_delegate
|
// swiftlint:disable:next weak_delegate
|
||||||
|
Loading…
Reference in New Issue
Block a user