mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
wait for release notes check and then open externally
This commit is contained in:
@ -422,35 +422,44 @@ func (f *FrontendQt) startManualUpdate() {
|
||||
}()
|
||||
}
|
||||
|
||||
func (f *FrontendQt) checkForUpdates() {
|
||||
func (f *FrontendQt) checkForUpdatesAndWait() {
|
||||
version, err := f.updater.Check()
|
||||
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||
f.Qml.NotifyManualUpdateError()
|
||||
return
|
||||
}
|
||||
|
||||
f.SetVersion(version)
|
||||
|
||||
if !f.updater.IsUpdateApplicable(version) {
|
||||
logrus.Debug("No need to update")
|
||||
return
|
||||
}
|
||||
|
||||
logrus.WithField("version", version.Version).Info("An update is available")
|
||||
|
||||
if !f.updater.CanInstall(version) {
|
||||
logrus.Debug("A manual update is required")
|
||||
f.NotifyManualUpdate(version, false)
|
||||
return
|
||||
}
|
||||
|
||||
f.NotifyManualUpdate(version, true)
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
||||
go func() {
|
||||
version, err := f.updater.Check()
|
||||
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||
f.Qml.NotifyManualUpdateError()
|
||||
return
|
||||
}
|
||||
|
||||
f.SetVersion(version)
|
||||
|
||||
if !f.updater.IsUpdateApplicable(version) {
|
||||
logrus.Debug("No need to update")
|
||||
return
|
||||
}
|
||||
|
||||
logrus.WithField("version", version.Version).Info("An update is available")
|
||||
|
||||
if !f.updater.CanInstall(version) {
|
||||
logrus.Debug("A manual update is required")
|
||||
f.NotifyManualUpdate(version, false)
|
||||
return
|
||||
}
|
||||
|
||||
f.NotifyManualUpdate(version, true)
|
||||
s.checkForUpdatesAndWait()
|
||||
s.Qml.OpenReleaseNotesExternally()
|
||||
}()
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkForUpdates() {
|
||||
go s.checkForUpdatesAndWait()
|
||||
}
|
||||
|
||||
func (f *FrontendQt) resetSource() {
|
||||
if f.transfer != nil {
|
||||
f.transfer.ResetRules()
|
||||
|
||||
@ -64,6 +64,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