mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Clean up WriteFreelyModel’s published vars
This commit is contained in:
parent
aefcd0d799
commit
3a53bec184
@ -6,25 +6,15 @@ import Network
|
||||
// MARK: - WriteFreelyModel
|
||||
|
||||
final class WriteFreelyModel: ObservableObject {
|
||||
|
||||
// MARK: - Models
|
||||
@Published var account = AccountModel()
|
||||
@Published var preferences = PreferencesModel()
|
||||
@Published var posts = PostListModel()
|
||||
@Published var editor = PostEditorModel()
|
||||
@Published var isLoggingIn: Bool = false
|
||||
@Published var isProcessingRequest: Bool = false
|
||||
@Published var hasNetworkConnection: Bool = true
|
||||
@Published var selectedPost: WFAPost?
|
||||
@Published var selectedCollection: WFACollection?
|
||||
@Published var showAllPosts: Bool = true
|
||||
@Published var isPresentingDeleteAlert: Bool = false
|
||||
@Published var postToDelete: WFAPost?
|
||||
|
||||
// MARK: - Error handling
|
||||
@Published var hasError: Bool = false
|
||||
#if os(iOS)
|
||||
@Published var isPresentingSettingsView: Bool = false
|
||||
#endif
|
||||
|
||||
static var shared = WriteFreelyModel()
|
||||
|
||||
var currentError: Error? {
|
||||
didSet {
|
||||
#if DEBUG
|
||||
@ -43,6 +33,21 @@ final class WriteFreelyModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - State
|
||||
@Published var isLoggingIn: Bool = false
|
||||
@Published var isProcessingRequest: Bool = false
|
||||
@Published var hasNetworkConnection: Bool = true
|
||||
@Published var selectedPost: WFAPost?
|
||||
@Published var selectedCollection: WFACollection?
|
||||
@Published var showAllPosts: Bool = true
|
||||
@Published var isPresentingDeleteAlert: Bool = false
|
||||
@Published var postToDelete: WFAPost?
|
||||
#if os(iOS)
|
||||
@Published var isPresentingSettingsView: Bool = false
|
||||
#endif
|
||||
|
||||
static var shared = WriteFreelyModel()
|
||||
|
||||
// swiftlint:disable line_length
|
||||
let helpURL = URL(string: "https://discuss.write.as/c/help/5")!
|
||||
let howToURL = URL(string: "https://discuss.write.as/t/using-the-writefreely-ios-app/1946")!
|
||||
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>ActionExtension-iOS.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
Loading…
Reference in New Issue
Block a user