Skip to content

Commit

Permalink
fix: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
shafqat-muneer committed Jan 22, 2025
1 parent 03fd971 commit ce763d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Discussion/Discussion/Presentation/Posts/PostsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public struct PostsView: View {
}
}
.onFirstAppear {
if viewModel.type != .allPosts && viewModel.type != .followingPosts {
if viewModel.isNotAllOrFollowingPosts() {
viewModel.trackDiscussionTopicViewed(
courseID: courseID,
topicID: topicID ?? ""
Expand Down
4 changes: 4 additions & 0 deletions Discussion/Discussion/Presentation/Posts/PostsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ public class PostsViewModel: ObservableObject {
self.filteredPosts = self.discussionPosts
}

func isNotAllOrFollowingPosts() -> Bool {
return type != .allPosts && type != .followingPosts
}

func trackDiscussionTopicViewed(
courseID: String,
topicID: String
Expand Down

0 comments on commit ce763d3

Please sign in to comment.