From 08b5cab875f1a84162bb47773bbe72135135b90e Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 22 Apr 2022 09:55:19 +0200 Subject: FSM: Make data for transitions optional --- src/state.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/state.go') diff --git a/src/state.go b/src/state.go index 52a4861..e15cb3c 100644 --- a/src/state.go +++ b/src/state.go @@ -51,7 +51,7 @@ func (state *VPNState) Register(name string, directory string, stateCallback fun // This error can be safely ignored, as when the config does not load, the struct will not be filled state.Log(LOG_INFO, "Previous configuration not found") } - state.GoTransition(NO_SERVER, "") + state.GoTransition(NO_SERVER) return nil } @@ -87,17 +87,17 @@ func (state *VPNState) Connect(url string) (string, error) { return "", loginErr } } else { // OAuth was valid, ensure we are in the authenticated state - state.GoTransition(AUTHENTICATED, "") + state.GoTransition(AUTHENTICATED) } - state.GoTransition(REQUEST_CONFIG, "") + state.GoTransition(REQUEST_CONFIG) config, configErr := state.Server.GetConfig() if configErr != nil { return "", configErr } else { - state.GoTransition(HAS_CONFIG, "") + state.GoTransition(HAS_CONFIG) } return config, nil -- cgit v1.2.3