mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-11 01:53:23 +01:00
parent
6e91295cc0
commit
6b88191dc5
@ -193,6 +193,18 @@ impl Inner {
|
|||||||
|
|
||||||
pub fn do_state_change(&mut self, new_state: MachineState) {
|
pub fn do_state_change(&mut self, new_state: MachineState) {
|
||||||
let old_state = self.replace_state(new_state);
|
let old_state = self.replace_state(new_state);
|
||||||
|
|
||||||
|
// Set "previous user" if state change warrants it
|
||||||
|
match old_state.state {
|
||||||
|
Status::InUse(ref user) => {
|
||||||
|
self.previous = user.clone();
|
||||||
|
},
|
||||||
|
Status::ToCheck(ref user) => {
|
||||||
|
self.previous = Some(user.clone());
|
||||||
|
},
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
|
||||||
self.reset.replace(old_state);
|
self.reset.replace(old_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user