mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Set and unset lastDraft based on selectedPost
This commit is contained in:
parent
903ea78a27
commit
9daf553391
@ -9,9 +9,18 @@ class WriteFreelyModel: ObservableObject {
|
||||
@Published var account = AccountModel()
|
||||
@Published var preferences = PreferencesModel()
|
||||
@Published var posts = PostListModel()
|
||||
@Published var editor = PostEditorModel()
|
||||
@Published var isLoggingIn: Bool = false
|
||||
@Published var hasNetworkConnection: Bool = false
|
||||
@Published var selectedPost: WFAPost?
|
||||
@Published var selectedPost: WFAPost? {
|
||||
didSet {
|
||||
if let post = selectedPost {
|
||||
if post.status != PostStatus.published.rawValue { editor.setLastDraft(post) }
|
||||
} else {
|
||||
editor.clearLastDraft()
|
||||
}
|
||||
}
|
||||
}
|
||||
@Published var isPresentingDeleteAlert: Bool = false
|
||||
@Published var postToDelete: WFAPost?
|
||||
#if os(iOS)
|
||||
|
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
Loading…
Reference in New Issue
Block a user