From 81849196971c127ea098077a89cc84616a15271e Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 10 Feb 2021 15:12:13 -0500 Subject: [PATCH] Create new draft in selected collection --- Shared/Navigation/ContentView.swift | 4 ---- Shared/PostEditor/PostEditorModel.swift | 2 +- Shared/WriteFreely_MultiPlatformApp.swift | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index 09d389f..a60322f 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -22,10 +22,6 @@ struct ContentView: View { withAnimation { // Un-set the currently selected post self.model.selectedPost = nil - - // Navigate to the Drafts list - self.model.showAllPosts = false - self.model.selectedCollection = nil } // Create the new-post managed object let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font) diff --git a/Shared/PostEditor/PostEditorModel.swift b/Shared/PostEditor/PostEditorModel.swift index 014681f..8219ead 100644 --- a/Shared/PostEditor/PostEditorModel.swift +++ b/Shared/PostEditor/PostEditorModel.swift @@ -32,7 +32,7 @@ struct PostEditorModel { managedPost.title = "" managedPost.body = "" managedPost.status = PostStatus.local.rawValue - managedPost.collectionAlias = nil + managedPost.collectionAlias = WriteFreelyModel.shared.selectedCollection?.alias switch appearance { case 1: managedPost.appearance = "sans" diff --git a/Shared/WriteFreely_MultiPlatformApp.swift b/Shared/WriteFreely_MultiPlatformApp.swift index 5fd1814..900a267 100644 --- a/Shared/WriteFreely_MultiPlatformApp.swift +++ b/Shared/WriteFreely_MultiPlatformApp.swift @@ -132,10 +132,6 @@ struct WriteFreely_MultiPlatformApp: App { withAnimation { // Un-set the currently selected post self.model.selectedPost = nil - - // Navigate to the Drafts list - self.model.showAllPosts = false - self.model.selectedCollection = nil } // Create the new-post managed object let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font)