From bdd39c79fa131e6ffa83ce1f55db126daa520049 Mon Sep 17 00:00:00 2001 From: Sjmarf <78750526+Sjmarf@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:24:54 +0000 Subject: [PATCH] Fix glide animation bug (#1502) --- Mlem/App/Views/Shared/CommentView.swift | 1 + Mlem/App/Views/Shared/Labels/FullyQualifiedLinkView.swift | 3 +++ Mlem/App/Views/Shared/ReplyView.swift | 1 + 3 files changed, 5 insertions(+) diff --git a/Mlem/App/Views/Shared/CommentView.swift b/Mlem/App/Views/Shared/CommentView.swift index 6be49db5b..db81f713c 100644 --- a/Mlem/App/Views/Shared/CommentView.swift +++ b/Mlem/App/Views/Shared/CommentView.swift @@ -87,6 +87,7 @@ struct CommentView: View { NavigationLink(.post(post)) { FooterLinkView(title: post.title, subtitle: comment.community_?.fullNameWithPrefix) } + .id("\(comment.id)_commment_footer") } if !compactComments { InteractionBarView( diff --git a/Mlem/App/Views/Shared/Labels/FullyQualifiedLinkView.swift b/Mlem/App/Views/Shared/Labels/FullyQualifiedLinkView.swift index 11744cf8d..ea021e9e4 100644 --- a/Mlem/App/Views/Shared/Labels/FullyQualifiedLinkView.swift +++ b/Mlem/App/Views/Shared/Labels/FullyQualifiedLinkView.swift @@ -17,6 +17,8 @@ struct FullyQualifiedLinkView: View { let showInstance: Bool let blurred: Bool + @State private var id = UUID() + init( entity: (any CommunityOrPersonStub & Profile2Providing)?, labelStyle: FullyQualifiedLabelStyle, @@ -48,5 +50,6 @@ struct FullyQualifiedLinkView: View { ) } .buttonStyle(.plain) + .id(id) } } diff --git a/Mlem/App/Views/Shared/ReplyView.swift b/Mlem/App/Views/Shared/ReplyView.swift index 5252fbcd8..4aeb45e8e 100644 --- a/Mlem/App/Views/Shared/ReplyView.swift +++ b/Mlem/App/Views/Shared/ReplyView.swift @@ -31,6 +31,7 @@ struct ReplyView: View { NavigationLink(.post(reply.post)) { FooterLinkView(title: reply.post.title, subtitle: reply.community.fullNameWithPrefix) } + .id("\(reply.id)_reply_footer") InteractionBarView( reply: reply, configuration: InteractionBarTracker.main.replyInteractionBar