GODT-1507: Enable autostart after Qt setup.

This commit is contained in:
Jakub
2022-03-02 11:10:48 +01:00
parent 73d1fe2f65
commit c7eb7234a2
4 changed files with 12 additions and 4 deletions

View File

@ -76,6 +76,15 @@ func (f *FrontendQt) changeLocalCache(enableDiskCache bool, diskCachePath *core.
}
func (f *FrontendQt) setIsAutostartOn() {
// GODT-1507 Windows: autostart needs to be created after Qt is initialized.
f.firstTimeAutostart.Do(func() {
if !f.bridge.IsFirstStart() {
return
}
if err := f.bridge.EnableAutostart(); err != nil {
f.log.WithError(err).Error("Failed to enable autostart")
}
})
f.qml.SetIsAutostartOn(f.bridge.IsAutostartEnabled())
}