Skip to content

Commit

Permalink
Update SkeletonModifier.swift
Browse files Browse the repository at this point in the history
don't re-animate on appear
-  (e.g. in a navStack)
  • Loading branch information
thisIsTheFoxe committed May 15, 2024
1 parent ab2b111 commit 64f6246
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/SkeletonUI/Modifiers/SkeletonModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public struct SkeletonModifier: ViewModifier {
.modifier(SkeletonAnimatableModifier(animate ? 1 : 0, appearance))
.clipShape(SkeletonShape(shape))
.animation(animation.type, value: animate)
.onAppear {
.onAppear {
guard !animate else { return }
DispatchQueue.main.async { animate.toggle() }
}
}
Expand Down

0 comments on commit 64f6246

Please sign in to comment.