summaryrefslogtreecommitdiff
path: root/macos/Sources/Features/Update/UpdateBadge.swift
diff options
context:
space:
mode:
Diffstat (limited to 'macos/Sources/Features/Update/UpdateBadge.swift')
-rw-r--r--macos/Sources/Features/Update/UpdateBadge.swift10
1 files changed, 10 insertions, 0 deletions
diff --git a/macos/Sources/Features/Update/UpdateBadge.swift b/macos/Sources/Features/Update/UpdateBadge.swift
index afd0849be..a4a95f411 100644
--- a/macos/Sources/Features/Update/UpdateBadge.swift
+++ b/macos/Sources/Features/Update/UpdateBadge.swift
@@ -14,6 +14,12 @@ struct UpdateBadge: View {
@State private var rotationAngle: Double = 0
var body: some View {
+ badgeContent
+ .accessibilityLabel(model.text)
+ }
+
+ @ViewBuilder
+ private var badgeContent: some View {
switch model.state {
case .downloading(let download):
if let expectedLength = download.expectedLength, expectedLength > 0 {
@@ -38,11 +44,15 @@ struct UpdateBadge: View {
.onDisappear {
rotationAngle = 0
}
+ } else {
+ EmptyView()
}
default:
if let iconName = model.iconName {
Image(systemName: iconName)
+ } else {
+ EmptyView()
}
}
}