diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-06 13:05:31 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-06 13:05:31 +0200 |
| commit | 55606240f6296ff8238164a6e510ee79722bf5c3 (patch) | |
| tree | 1bfb729985093d975c94302a9be43552e2078bfb /state.go | |
| parent | efe37d710cbc8097b02f06e3350f0e8467a23058 (diff) | |
State + FSM + Python: Rename the HAS_CONFIG state to DISCONNECTED
Diffstat (limited to 'state.go')
| -rw-r--r-- | state.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -152,7 +152,7 @@ func (state *VPNState) getConfig( } // Signal the server display info - state.FSM.GoTransitionWithData(fsm.HAS_CONFIG, state.getServerInfoData(), false) + state.FSM.GoTransitionWithData(fsm.DISCONNECTED, state.getServerInfoData(), false) // Save the config state.Config.Save(&state) @@ -522,16 +522,16 @@ func (state *VPNState) SetDisconnecting() error { func (state *VPNState) SetDisconnected(cleanup bool) error { errorMessage := "failed to set disconnected" - if state.InFSMState(fsm.HAS_CONFIG) { + if state.InFSMState(fsm.DISCONNECTED) { // already disconnected, show no error return nil } - if !state.FSM.HasTransition(fsm.HAS_CONFIG) { + if !state.FSM.HasTransition(fsm.DISCONNECTED) { return &types.WrappedErrorMessage{ Message: errorMessage, Err: fsm.WrongStateTransitionError{ Got: state.FSM.Current, - Want: fsm.HAS_CONFIG, + Want: fsm.DISCONNECTED, }.CustomError(), } } @@ -555,7 +555,7 @@ func (state *VPNState) SetDisconnected(cleanup bool) error { server.Disconnect(currentServer) } - state.FSM.GoTransitionWithData(fsm.HAS_CONFIG, state.getServerInfoData(), false) + state.FSM.GoTransitionWithData(fsm.DISCONNECTED, state.getServerInfoData(), false) return nil } @@ -598,7 +598,7 @@ func (state *VPNState) RenewSession() error { } func (state *VPNState) ShouldRenewButton() bool { - if !state.InFSMState(fsm.CONNECTED) && !state.InFSMState(fsm.CONNECTING) && !state.InFSMState(fsm.HAS_CONFIG) && !state.InFSMState(fsm.DISCONNECTING) { + if !state.InFSMState(fsm.CONNECTED) && !state.InFSMState(fsm.CONNECTING) && !state.InFSMState(fsm.DISCONNECTED) && !state.InFSMState(fsm.DISCONNECTING) { return false } |
