From 15f2efc9aa77893d5300d198dd3b5c42549018e8 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 27 Aug 2021 19:45:41 +0200 Subject: [ui] refactor ui --- pkg/backend/init.go | 4 +++- pkg/backend/status.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/backend') 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 -- cgit v1.2.3