mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 06:47:56 +01:00
parent
6e91295cc0
commit
6b88191dc5
@ -192,8 +192,20 @@ impl Inner {
|
||||
}
|
||||
|
||||
pub fn do_state_change(&mut self, new_state: MachineState) {
|
||||
let old_state = self.replace_state(new_state);
|
||||
self.reset.replace(old_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);
|
||||
}
|
||||
|
||||
pub fn read_state(&self) -> ReadOnlyMutable<MachineState> {
|
||||
|
Loading…
Reference in New Issue
Block a user