Skip to content

Commit

Permalink
Update some buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
milanvarady committed Jan 13, 2025
1 parent df735fe commit d75c281
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extension AppView {
alert.show(error: error, title: "Failed to gather cask info")
logger.error("Failed to gather additional cask info: \(error.localizedDescription)")
}
.asyncButtonStyle(.trailing)
.alertManager(alert)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension AppView {
.onButtonError { error in
showAppNotFoundAlert = true
}
.asyncButtonStyle(.none)
.alert("Applite couldn't open \(cask.info.name)", isPresented: $showAppNotFoundAlert) {}

if deleteButton {
Expand Down
2 changes: 1 addition & 1 deletion Applite/Views/App Views/AppliteAppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct AppliteAppView: View {

CheckForUpdatesView(updater: updaterController.updater) {
Label("Update", systemImage: "arrow.uturn.down")
.foregroundColor(.blue)
.buttonStyle(.borderedProminent)
}
.clipShape(Capsule())

Expand Down
11 changes: 2 additions & 9 deletions Applite/Views/Detail Views/Update/UpdateView+ToolbarItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ extension UpdateView {
var toolbarItems: some ToolbarContent {
ToolbarItemGroup {
greedyUpdateButton

// Refresh outdated casks
if refreshing {
SmallProgressView()
} else {
refreshButton
}
refreshButton
}
}

Expand All @@ -36,6 +30,7 @@ extension UpdateView {
.onButtonError { error in
loadAlert.show(title: "Failed to load updates", message: error.localizedDescription)
}
.asyncButtonStyle(.none)

Button("Cancel", role: .cancel) {}
} message: {
Expand All @@ -48,9 +43,7 @@ extension UpdateView {

private var refreshButton: some View {
AsyncButton {
refreshing = true
try await caskManager.refreshOutdated()
refreshing = false
} label: {
Image(systemName: "arrow.clockwise")
}
Expand Down
1 change: 0 additions & 1 deletion Applite/Views/Detail Views/Update/UpdateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct UpdateView: View {
@EnvironmentObject var caskManager: CaskManager

@State var searchText = ""
@State var refreshing = false
@State var isUpdatingAll = false
@State var updateAllButtonRotation = 0.0

Expand Down

0 comments on commit d75c281

Please sign in to comment.