Create new draft in selected collection

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

View File

@ -22,10 +22,6 @@ struct ContentView: View {
withAnimation { withAnimation {
// Un-set the currently selected post // Un-set the currently selected post
self.model.selectedPost = nil self.model.selectedPost = nil
// Navigate to the Drafts list
self.model.showAllPosts = false
self.model.selectedCollection = nil
} }
// Create the new-post managed object // Create the new-post managed object
let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font) let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font)

View File

@ -32,7 +32,7 @@ struct PostEditorModel {
managedPost.title = "" managedPost.title = ""
managedPost.body = "" managedPost.body = ""
managedPost.status = PostStatus.local.rawValue managedPost.status = PostStatus.local.rawValue
managedPost.collectionAlias = nil managedPost.collectionAlias = WriteFreelyModel.shared.selectedCollection?.alias
switch appearance { switch appearance {
case 1: case 1:
managedPost.appearance = "sans" managedPost.appearance = "sans"

View File

@ -132,10 +132,6 @@ struct WriteFreely_MultiPlatformApp: App {
withAnimation { withAnimation {
// Un-set the currently selected post // Un-set the currently selected post
self.model.selectedPost = nil self.model.selectedPost = nil
// Navigate to the Drafts list
self.model.showAllPosts = false
self.model.selectedCollection = nil
} }
// Create the new-post managed object // Create the new-post managed object
let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font) let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font)