vector-im/element-ios/issues/5298 - Prevent the activity indicator modifier from reloading the whole view hierarchy.

This commit is contained in:
Stefan Ceriu
2021-12-16 13:29:50 +02:00
committed by Stefan Ceriu
parent fc56a7c267
commit 27d3a27c2f
@@ -21,14 +21,17 @@ import SwiftUI
/// A modifier for showing the activity indicator centered over a view.
struct ActivityIndicatorModifier: ViewModifier {
var show: Bool
@ViewBuilder
func body(content: Content) -> some View {
content
.overlay(activityIndicator, alignment: .center)
}
@ViewBuilder
private var activityIndicator: some View {
if show {
content
.overlay(ActivityIndicator(), alignment: .center)
} else {
content
ActivityIndicator()
}
}
}