summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-08-27 19:45:41 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-11-23 21:50:58 +0100
commitcd1d46a26b923260b6c87cc93a0723b8166c609e (patch)
tree81d0fafeaeda6f5d72ec03f589cf8560cea32ed8 /pkg
parent76585f828a36c08614df84f43d64e20fb0e7a425 (diff)
[ui] refactor ui
Diffstat (limited to 'pkg')
-rw-r--r--pkg/backend/init.go4
-rw-r--r--pkg/backend/status.go1
2 files changed, 4 insertions, 1 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index b7469c1..fcde725 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -29,10 +29,11 @@ func initializeContext(opts *InitOpts) {
DonateDialog: false,
Version: version.VERSION,
Status: st,
+ IsReady: false,
}
errCh := make(chan string)
- go trigger(OnStatusChanged)
go checkErrors(errCh)
+ // isReady is set after Bitmask initialization
initializeBitmask(errCh, opts)
go trigger(OnStatusChanged)
ctx.delayCheckForGateways()
@@ -86,6 +87,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
errCh <- "nopolkit"
}
ctx.bm = b
+ ctx.IsReady = true
}
func setConfigOpts(opts *InitOpts, conf *config.Config) {
diff --git a/pkg/backend/status.go b/pkg/backend/status.go
index 1ec5c4f..0ffd853 100644
--- a/pkg/backend/status.go
+++ b/pkg/backend/status.go
@@ -49,6 +49,7 @@ type connectionCtx struct {
CurrentLocation string `json:"currentLocation"`
CurrentCountry string `json:"currentCountry"`
ManualLocation bool `json:"manualLocation"`
+ IsReady bool `json:"isReady"`
bm bitmask.Bitmask
autostart bitmask.Autostart
cfg *config.Config