Fix issue with loading view using the redacted modifier

Also tried to make some adjusmtents to the refresh subscribtion to see
if this fixes bugs people were having

Closes: #119

Changelog-Fixed: Fixed issues when refreshing global view
This commit is contained in:
Sam DuBois
2022-12-22 17:23:55 -07:00
committed by William Casarin
parent 514d9f4201
commit 549cbb9bce
6 changed files with 62 additions and 54 deletions

View File

@@ -41,6 +41,7 @@ struct ShimmeringView<Content: View>: View {
_startPoint = .init(wrappedValue: configuration.initialLocation.start)
_endPoint = .init(wrappedValue: configuration.initialLocation.end)
}
var body: some View {
ZStack {
content()
@@ -71,7 +72,12 @@ public struct ShimmerModifier: ViewModifier {
public extension View {
func shimmer(configuration: ShimmerConfiguration = .default) -> some View {
modifier(ShimmerModifier(configuration: configuration))
@ViewBuilder func shimmer(configuration: ShimmerConfiguration = .default, _ loading: Bool) -> some View {
if loading {
modifier(ShimmerModifier(configuration: configuration))
} else {
self
}
}
}