Skip to content

Commit 0884f85

Browse files
authored
Merge pull request #437 from chickdan/install_activity_indicator
Activity Indicator on Install Pressed
2 parents 0d631e6 + 9622b56 commit 0884f85

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Xcodes/Backend/XcodeCommands.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,21 @@ struct XcodeCommands: Commands {
3535

3636
struct InstallButton: View {
3737
@EnvironmentObject var appState: AppState
38+
@State private var isLoading = false
39+
3840
let xcode: Xcode?
39-
41+
4042
var body: some View {
41-
Button(action: install) {
43+
ProgressButton(isInProgress: isLoading) {
44+
install()
45+
} label: {
4246
Text("Install")
43-
.help("Install")
47+
.help("InstallDescription")
4448
}
4549
}
46-
50+
4751
private func install() {
52+
isLoading = true
4853
guard let xcode = xcode else { return }
4954
appState.checkMinVersionAndInstall(id: xcode.id)
5055
}

Xcodes/Frontend/XcodeList/XcodeListViewRow.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ struct XcodeListViewRow: View {
110110
.buttonStyle(AppStoreButtonStyle(primary: true, highlighted: selected))
111111
.help("OpenDescription")
112112
case .notInstalled:
113-
Button("Install") { appState.checkMinVersionAndInstall(id: xcode.id) }
113+
InstallButton(xcode: xcode)
114114
.textCase(.uppercase)
115-
.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: selected))
116-
.help("InstallDescription")
115+
.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false))
117116
case let .installing(installationStep):
118117
InstallationStepRowView(
119118
installationStep: installationStep,

0 commit comments

Comments
 (0)