diff --git a/Shared/PostList/PostListView.swift b/Shared/PostList/PostListView.swift index 271e4e8..972ad38 100644 --- a/Shared/PostList/PostListView.swift +++ b/Shared/PostList/PostListView.swift @@ -36,25 +36,7 @@ struct PostListView: View { ZStack { Spacer() Button(action: { - let managedPost = WFAPost(context: self.managedObjectContext) - managedPost.createdDate = Date() - managedPost.title = "" - managedPost.body = "" - managedPost.status = PostStatus.local.rawValue - managedPost.collectionAlias = nil - switch model.preferences.font { - case 1: - managedPost.appearance = "sans" - case 2: - managedPost.appearance = "wrap" - default: - managedPost.appearance = "serif" - } - if let languageCode = Locale.current.languageCode { - managedPost.language = languageCode - //swiftlint:disable:next line_length - managedPost.rtl = Locale.characterDirection(forLanguage: languageCode) == .rightToLeft - } + let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font) withAnimation { self.model.showAllPosts = false self.model.selectedCollection = nil