GODT-976 Exclude updates from clearing cache and clear cache, including updates, while switching early access off

This commit is contained in:
Michal Horejsek
2021-01-27 09:16:04 +01:00
parent c6107dbd4b
commit 7468ed7dc0
18 changed files with 241 additions and 13 deletions

View File

@ -578,13 +578,21 @@ func (s *FrontendQt) toggleAutoUpdate() {
func (s *FrontendQt) toggleEarlyAccess() {
defer s.Qml.ProcessFinished()
if updater.UpdateChannel(s.settings.Get(settings.UpdateChannelKey)) == updater.EarlyChannel {
s.settings.Set(settings.UpdateChannelKey, string(updater.StableChannel))
s.Qml.SetIsEarlyAccess(false)
channel := s.bridge.GetUpdateChannel()
if channel == updater.EarlyChannel {
channel = updater.StableChannel
} else {
s.settings.Set(settings.UpdateChannelKey, string(updater.EarlyChannel))
s.Qml.SetIsEarlyAccess(true)
channel = updater.EarlyChannel
}
err := s.bridge.SetUpdateChannel(channel)
s.Qml.SetIsEarlyAccess(channel == updater.EarlyChannel)
if err != nil {
s.Qml.NotifyManualUpdateError()
return
}
s.restarter.SetToRestart()
s.App.Quit()
}
func (s *FrontendQt) toggleAllowProxy() {