fix: better first start setting

This commit is contained in:
James Houlahan
2020-08-05 15:09:08 +02:00
parent f651d39820
commit 34ef9063cb
5 changed files with 3 additions and 7 deletions

View File

@ -29,8 +29,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
* github.com/urfave/cli v1.22.3 -> v1.22.4
* golang.org/x/net 20200301022130-244492dfa37a -> 20200707034311-ab3426394381
* golang.org/x/text v0.3.2 -> v0.3.3
* Set first-start to false in bridge, not in frontend.
### Fixed
* GODT-454 Fix send on closed channel when receiving unencrypted send confirmation from GUI.

View File

@ -70,6 +70,7 @@ func New(
if pref.GetBool(preferences.FirstStartKey) {
b.SendMetric(metrics.New(metrics.Setup, metrics.FirstStart, metrics.Label(config.GetVersion())))
pref.SetBool(preferences.FirstStartKey, false)
}
go b.heartbeat()

View File

@ -32,6 +32,7 @@ type StoreFactoryConfiger interface {
type PreferenceProvider interface {
Get(key string) string
GetBool(key string) bool
SetBool(key string, val bool)
GetInt(key string) int
Set(key string, value string)
}

View File

@ -21,7 +21,6 @@ package cli
import (
"github.com/ProtonMail/proton-bridge/internal/events"
"github.com/ProtonMail/proton-bridge/internal/frontend/types"
"github.com/ProtonMail/proton-bridge/internal/preferences"
"github.com/ProtonMail/proton-bridge/pkg/config"
"github.com/ProtonMail/proton-bridge/pkg/listener"
@ -241,8 +240,6 @@ func (f *frontendCLI) Loop(credentialsError error) error {
return credentialsError
}
f.preferences.SetBool(preferences.FirstStartKey, false)
f.Print(`
Welcome to ProtonMail Bridge interactive shell
___....___

View File

@ -317,8 +317,6 @@ func (s *FrontendQt) qtExecute(Procedure func(*FrontendQt) error) error {
// Set first start flag.
s.Qml.SetIsFirstStart(s.preferences.GetBool(preferences.FirstStartKey))
// Don't repeat next start.
s.preferences.SetBool(preferences.FirstStartKey, false)
// Check if it is first start after update (fresh version).
lastVersion := s.preferences.Get(preferences.LastVersionKey)