File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,16 +35,21 @@ struct XcodeCommands: Commands {
3535
3636struct 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 }
Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments