mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 11:02:48 +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
b9e718c6a8
commit
df90794fc5
@@ -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