mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
vector-im/element-ios/issues/5298 - Prevent the activity indicator modifier from reloading the whole view hierarchy.
This commit is contained in:
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user