forked from Silverfish/proton-bridge
wait for release notes check and then open externally
This commit is contained in:
@ -414,35 +414,44 @@ func (s *FrontendQt) openLogs() {
|
||||
go open.Run(logsPath)
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkForUpdates() {
|
||||
func (s *FrontendQt) checkForUpdatesAndWait() {
|
||||
version, err := s.updater.Check()
|
||||
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||
s.Qml.NotifyManualUpdateError()
|
||||
return
|
||||
}
|
||||
|
||||
s.SetVersion(version)
|
||||
|
||||
if !s.updater.IsUpdateApplicable(version) {
|
||||
logrus.Debug("No need to update")
|
||||
return
|
||||
}
|
||||
|
||||
logrus.WithField("version", version.Version).Info("An update is available")
|
||||
|
||||
if !s.updater.CanInstall(version) {
|
||||
logrus.Debug("A manual update is required")
|
||||
s.NotifyManualUpdate(version, false)
|
||||
return
|
||||
}
|
||||
|
||||
s.NotifyManualUpdate(version, true)
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
||||
go func() {
|
||||
version, err := s.updater.Check()
|
||||
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||
s.Qml.NotifyManualUpdateError()
|
||||
return
|
||||
}
|
||||
|
||||
s.SetVersion(version)
|
||||
|
||||
if !s.updater.IsUpdateApplicable(version) {
|
||||
logrus.Debug("No need to update")
|
||||
return
|
||||
}
|
||||
|
||||
logrus.WithField("version", version.Version).Info("An update is available")
|
||||
|
||||
if !s.updater.CanInstall(version) {
|
||||
logrus.Debug("A manual update is required")
|
||||
s.NotifyManualUpdate(version, false)
|
||||
return
|
||||
}
|
||||
|
||||
s.NotifyManualUpdate(version, true)
|
||||
s.checkForUpdatesAndWait()
|
||||
s.Qml.OpenReleaseNotesExternally()
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkForUpdates() {
|
||||
go s.checkForUpdatesAndWait()
|
||||
}
|
||||
|
||||
func (s *FrontendQt) openLicenseFile() {
|
||||
go open.Run(s.locations.GetLicenseFilePath())
|
||||
}
|
||||
|
||||
@ -61,6 +61,8 @@ type GoQMLInterface struct {
|
||||
_ func() `signal:"notifySilentUpdateRestartNeeded"`
|
||||
_ func() `signal:"notifySilentUpdateError"`
|
||||
_ func() `slot:"checkForUpdates"`
|
||||
_ func() `slot:"checkAndOpenReleaseNotes"`
|
||||
_ func() `signal:"openReleaseNotesExternally"`
|
||||
_ func() `slot:"startManualUpdate"`
|
||||
|
||||
// Translations.
|
||||
|
||||
Reference in New Issue
Block a user