Skip to content

Commit

Permalink
Fix bug with animating loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdifran committed Dec 30, 2024
1 parent de59df0 commit 1b17018
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/AppUI/Components/Loading/CircularSpinnerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ public struct CircularSpinnerView: View {
.trim(from: 0, to: 0.7)
.stroke(style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
.frame(square: 20)
.fixedSize()
.rotationEffect(.degrees(isSpinning ? 360 : 0))
.animation(.linear(duration: 1).repeatForever(autoreverses: false), value: isSpinning)
.onAppear {
isSpinning = true
withAnimation(.linear(duration: 1).repeatForever(autoreverses: false)) {
isSpinning = true
}
}
}
}
Expand Down

0 comments on commit 1b17018

Please sign in to comment.