From 06a7453984adca0b34e62421a1baa8fe54b0d7bb Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Mon, 22 Jun 2020 22:00:23 +0200 Subject: [refactor] several simplifications after review - simplify notification routine (we dont need no rejected action). we just check every hour, as in the original code. - open links directly from Qt - rename some global variables to make them less cryptic - move cleanup function to the same module that created them --- pkg/backend/api.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'pkg/backend/api.go') diff --git a/pkg/backend/api.go b/pkg/backend/api.go index 74220ed..cf9ec5c 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -6,7 +6,6 @@ import ( "C" "fmt" "log" - "time" "unsafe" "0xacab.org/leap/bitmask-vpn/pkg/bitmask" @@ -34,17 +33,13 @@ func Quit() { ctx.cfg.SetUserStoppedVPN(true) stopVPN() } - cleanupTempDirs() + cleanup() } func DonateAccepted() { donateAccepted() } -func DonateRejected() { - donateRejected() -} - func SubscribeToEvent(event string, f unsafe.Pointer) { subscribe(event, f) } @@ -53,17 +48,8 @@ func InitializeBitmaskContext() { p := bitmask.GetConfiguredProvider() initOnce.Do(func() { initializeContext(p.Provider, p.AppName) }) + runDonationReminder() go ctx.updateStatus() - - go func() { - if needsDonationReminder() { - // wait a bit before launching reminder - timer := time.NewTimer(time.Minute * 5) - <-timer.C - showDonate() - } - - }() } func RefreshContext() *C.char { -- cgit v1.2.3