File tree Expand file tree Collapse file tree 13 files changed +543
-338
lines changed
Expand file tree Collapse file tree 13 files changed +543
-338
lines changed Original file line number Diff line number Diff line change @@ -76,4 +76,20 @@ extension Comment {
7676 }
7777 }
7878 }
79+
80+ // MARK: Helpers
81+
82+ /// Returns an associated site ID.
83+ ///
84+ /// - note: The `Comment` class can be used in two different contexts:
85+ /// Reader and Site, and this property works accordingly.
86+ var associatedSiteID : NSNumber ? {
87+ if let post = post as? ReaderPost {
88+ return post. siteID
89+ } else if let blogID = blog? . dotComID {
90+ return blogID
91+ } else {
92+ return nil
93+ }
94+ }
7995}
Original file line number Diff line number Diff line change @@ -982,11 +982,11 @@ private extension CommentDetailViewController {
982982 }
983983
984984 @objc func buttonAddCommentTapped( ) {
985- let viewModel = CommentComposerViewModel . create ( replyingTo: comment)
985+ let viewModel = CommentCreateViewModel ( replyingTo: comment)
986986 viewModel. save = { [ weak self] in
987987 try await self ? . createReply ( content: $0)
988988 }
989- let composerVC = CommentComposerViewController ( viewModel: viewModel)
989+ let composerVC = CommentCreateViewController ( viewModel: viewModel)
990990 let navigationVC = UINavigationController ( rootViewController: composerVC)
991991 present ( navigationVC, animated: true )
992992 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments