mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
GDOT-1007 Notify user when version is the latest.
This commit is contained in:
@ -308,6 +308,7 @@ Window {
|
|||||||
signal notifySilentUpdateError()
|
signal notifySilentUpdateError()
|
||||||
function checkForUpdates() {
|
function checkForUpdates() {
|
||||||
console.log("checkForUpdates")
|
console.log("checkForUpdates")
|
||||||
|
go.notifyVersionIsTheLatest()
|
||||||
}
|
}
|
||||||
function startManualUpdate() {
|
function startManualUpdate() {
|
||||||
console.log("startManualUpdate")
|
console.log("startManualUpdate")
|
||||||
|
|||||||
@ -868,6 +868,7 @@ Window {
|
|||||||
signal notifySilentUpdateError()
|
signal notifySilentUpdateError()
|
||||||
function checkForUpdates() {
|
function checkForUpdates() {
|
||||||
console.log("checkForUpdates")
|
console.log("checkForUpdates")
|
||||||
|
go.notifyVersionIsTheLatest()
|
||||||
}
|
}
|
||||||
function startManualUpdate() {
|
function startManualUpdate() {
|
||||||
console.log("startManualUpdate")
|
console.log("startManualUpdate")
|
||||||
|
|||||||
@ -425,20 +425,20 @@ func (f *FrontendQt) startManualUpdate() {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FrontendQt) checkForUpdatesAndWait() {
|
func (f *FrontendQt) checkIsLatestVersionAndUpdate() bool {
|
||||||
version, err := f.updater.Check()
|
version, err := f.updater.Check()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||||
f.Qml.NotifyManualUpdateError()
|
f.Qml.NotifyManualUpdateError()
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
f.SetVersion(version)
|
f.SetVersion(version)
|
||||||
|
|
||||||
if !f.updater.IsUpdateApplicable(version) {
|
if !f.updater.IsUpdateApplicable(version) {
|
||||||
logrus.Debug("No need to update")
|
logrus.Debug("No need to update")
|
||||||
return
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
logrus.WithField("version", version.Version).Info("An update is available")
|
logrus.WithField("version", version.Version).Info("An update is available")
|
||||||
@ -446,21 +446,26 @@ func (f *FrontendQt) checkForUpdatesAndWait() {
|
|||||||
if !f.updater.CanInstall(version) {
|
if !f.updater.CanInstall(version) {
|
||||||
logrus.Debug("A manual update is required")
|
logrus.Debug("A manual update is required")
|
||||||
f.NotifyManualUpdate(version, false)
|
f.NotifyManualUpdate(version, false)
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
f.NotifyManualUpdate(version, true)
|
f.NotifyManualUpdate(version, true)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
||||||
go func() {
|
go func() {
|
||||||
s.checkForUpdatesAndWait()
|
_ = s.checkIsLatestVersionAndUpdate()
|
||||||
s.Qml.OpenReleaseNotesExternally()
|
s.Qml.OpenReleaseNotesExternally()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) checkForUpdates() {
|
func (s *FrontendQt) checkForUpdates() {
|
||||||
go s.checkForUpdatesAndWait()
|
go func() {
|
||||||
|
if s.checkIsLatestVersionAndUpdate() {
|
||||||
|
s.Qml.NotifyVersionIsTheLatest()
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FrontendQt) resetSource() {
|
func (f *FrontendQt) resetSource() {
|
||||||
|
|||||||
@ -414,20 +414,20 @@ func (s *FrontendQt) openLogs() {
|
|||||||
go open.Run(logsPath)
|
go open.Run(logsPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) checkForUpdatesAndWait() {
|
func (s *FrontendQt) checkIsLatestVersionAndUpdate() bool {
|
||||||
version, err := s.updater.Check()
|
version, err := s.updater.Check()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
logrus.WithError(err).Error("An error occurred while checking updates manually")
|
||||||
s.Qml.NotifyManualUpdateError()
|
s.Qml.NotifyManualUpdateError()
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
s.SetVersion(version)
|
s.SetVersion(version)
|
||||||
|
|
||||||
if !s.updater.IsUpdateApplicable(version) {
|
if !s.updater.IsUpdateApplicable(version) {
|
||||||
logrus.Debug("No need to update")
|
logrus.Debug("No need to update")
|
||||||
return
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
logrus.WithField("version", version.Version).Info("An update is available")
|
logrus.WithField("version", version.Version).Info("An update is available")
|
||||||
@ -435,21 +435,26 @@ func (s *FrontendQt) checkForUpdatesAndWait() {
|
|||||||
if !s.updater.CanInstall(version) {
|
if !s.updater.CanInstall(version) {
|
||||||
logrus.Debug("A manual update is required")
|
logrus.Debug("A manual update is required")
|
||||||
s.NotifyManualUpdate(version, false)
|
s.NotifyManualUpdate(version, false)
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
s.NotifyManualUpdate(version, true)
|
s.NotifyManualUpdate(version, true)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
func (s *FrontendQt) checkAndOpenReleaseNotes() {
|
||||||
go func() {
|
go func() {
|
||||||
s.checkForUpdatesAndWait()
|
_ = s.checkIsLatestVersionAndUpdate()
|
||||||
s.Qml.OpenReleaseNotesExternally()
|
s.Qml.OpenReleaseNotesExternally()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) checkForUpdates() {
|
func (s *FrontendQt) checkForUpdates() {
|
||||||
go s.checkForUpdatesAndWait()
|
go func() {
|
||||||
|
if s.checkIsLatestVersionAndUpdate() {
|
||||||
|
s.Qml.NotifyVersionIsTheLatest()
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FrontendQt) openLicenseFile() {
|
func (s *FrontendQt) openLicenseFile() {
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
* GODT-1007 Notify user when version is the latest.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
@ -14,3 +15,4 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* GODT-787 GODT-978 Fix IE and Bridge importing to sent not showing up in inbox (setting up flags properly).
|
* GODT-787 GODT-978 Fix IE and Bridge importing to sent not showing up in inbox (setting up flags properly).
|
||||||
* GODT-1006 Use correct macOS keychain name.
|
* GODT-1006 Use correct macOS keychain name.
|
||||||
* GODT-1009 Set ContentID if present and not explicitly attachment.
|
* GODT-1009 Set ContentID if present and not explicitly attachment.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user