From 6c6ab8f64309320b7a1a0a15f538cbc35a904a4e Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Fri, 9 Feb 2024 04:04:06 -0500 Subject: [PATCH] fixed dupes in profile feed (#920) --- Mlem/Views/Tabs/Profile/UserView+Logic.swift | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Mlem/Views/Tabs/Profile/UserView+Logic.swift b/Mlem/Views/Tabs/Profile/UserView+Logic.swift index 1e9ae01c5..e27e35e01 100644 --- a/Mlem/Views/Tabs/Profile/UserView+Logic.swift +++ b/Mlem/Views/Tabs/Profile/UserView+Logic.swift @@ -47,15 +47,6 @@ extension UserView { communityTracker.replaceAll(with: user.moderatedCommunities ?? []) - var savedContentData: GetPersonDetailsResponse? - if isOwnProfile { - savedContentData = try await personRepository.loadUserDetails( - for: user.userId, - limit: internetSpeed.pageSize, - savedOnly: true - ) - } - // accumulate comments and posts so we don't update state more than we need to var newComments = authoredContent.comments .sorted(by: { $0.comment.published > $1.comment.published }) @@ -63,16 +54,6 @@ extension UserView { var newPosts = authoredContent.posts.map { PostModel(from: $0) } - // add saved content, if present - if let savedContent = savedContentData { - newComments.append(contentsOf: - savedContent.comments - .sorted(by: { $0.comment.published > $1.comment.published }) - .map { HierarchicalComment(comment: $0, children: [], parentCollapsed: false, collapsed: false) }) - - newPosts.append(contentsOf: savedContent.posts.map { PostModel(from: $0) }) - } - privateCommentTracker.comments = newComments await privatePostTracker.reset(with: newPosts)