mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Merge pull request #437 from chickdan/install_activity_indicator
Activity Indicator on Install Pressed
This commit is contained in:
commit
0884f85359
2 changed files with 11 additions and 7 deletions
|
|
@ -35,16 +35,21 @@ struct XcodeCommands: Commands {
|
|||
|
||||
struct InstallButton: View {
|
||||
@EnvironmentObject var appState: AppState
|
||||
@State private var isLoading = false
|
||||
|
||||
let xcode: Xcode?
|
||||
|
||||
|
||||
var body: some View {
|
||||
Button(action: install) {
|
||||
ProgressButton(isInProgress: isLoading) {
|
||||
install()
|
||||
} label: {
|
||||
Text("Install")
|
||||
.help("Install")
|
||||
.help("InstallDescription")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func install() {
|
||||
isLoading = true
|
||||
guard let xcode = xcode else { return }
|
||||
appState.checkMinVersionAndInstall(id: xcode.id)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,10 +110,9 @@ struct XcodeListViewRow: View {
|
|||
.buttonStyle(AppStoreButtonStyle(primary: true, highlighted: selected))
|
||||
.help("OpenDescription")
|
||||
case .notInstalled:
|
||||
Button("Install") { appState.checkMinVersionAndInstall(id: xcode.id) }
|
||||
InstallButton(xcode: xcode)
|
||||
.textCase(.uppercase)
|
||||
.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: selected))
|
||||
.help("InstallDescription")
|
||||
.buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false))
|
||||
case let .installing(installationStep):
|
||||
InstallationStepRowView(
|
||||
installationStep: installationStep,
|
||||
|
|
|
|||
Loading…
Reference in a new issue