Skip to content

Commit

Permalink
fixed duplicate links triggering SwiftUI duplicate ID errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews committed Dec 14, 2023
1 parent a40c3a5 commit 217c857
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Mlem/Views/Shared/Components/EasyTapLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@ enum LinkType {
extension LinkType: Hashable, Identifiable {
func hash(into hasher: inout Hasher) {
switch self {
case let .website(_, title, url):
case let .website(position, title, url):
hasher.combine(0)
hasher.combine(position)
hasher.combine(title)
hasher.combine(url)
case let .user(_, _, _, url):
case let .user(position, _, _, url):
hasher.combine(1)
hasher.combine(position)
hasher.combine(url)
case let .community(_, _, _, url):
case let .community(position, _, _, url):
hasher.combine(2)
hasher.combine(position)
hasher.combine(url)
}
}
Expand Down

0 comments on commit 217c857

Please sign in to comment.