functional
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled

This commit is contained in:
2025-07-22 09:00:31 -07:00
parent b744b6bc2b
commit abb9f3a0e5
6 changed files with 48 additions and 25 deletions

View File

@@ -201,17 +201,30 @@ func PatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
}
debug.Println("Downloading updates from Project Epoch servers.")
stats, err := epoch.Update(paths.EpochPath, true, true, false)
if err != nil {
errMsg := fmt.Sprintf("failed to update Epoch files: %v", err)
dialog.ShowError(errors.New(errMsg), myWindow)
log.Println(errMsg)
}
log.Printf("Successfully updated %d Epoch files", stats.Updated)
debug.Println("Epoch patching with bundled resources completed successfully.")
dialog.ShowInformation("Success", "Epoch patching process completed.", myWindow)
// TODO: Change from dialog to pulsing animation
dialog.ShowInformation("Downloading patches", "Downloading patches for Project Epoch, this will take some time. Please wait until the status changes to \"Patched\"", myWindow)
paths.DownloadingPatches = true
go func() {
stats, err := epoch.Update(paths.EpochPath, true, true, false)
if err != nil {
errMsg := fmt.Sprintf("failed to update Epoch files: %v", err)
fyne.Do(func() {
dialog.ShowError(errors.New(errMsg), myWindow)
})
paths.DownloadingPatches = false
log.Println(errMsg)
}
log.Printf("Successfully updated %d Epoch files", stats.Updated)
debug.Println("Epoch patching with bundled resources completed successfully.")
fyne.Do(func() {
dialog.ShowInformation("Success", "Epoch patching process completed.", myWindow)
})
fyne.DoAndWait(func() {
paths.DownloadingPatches = false
updateAllStatuses()
})
}()
updateAllStatuses()
}