summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
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