Revert ctx state for remote backend when user clicks on previous
This commit is contained in:
parent
cc57f8f749
commit
80077905a6
@ -72,6 +72,10 @@ impl Installer {
|
||||
{
|
||||
self.current -= 1;
|
||||
}
|
||||
|
||||
if let Some(step) = self.steps.get(self.current) {
|
||||
step.revert(&mut self.context)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(
|
||||
|
||||
@ -260,6 +260,12 @@ impl Step for ChooseBackend {
|
||||
true
|
||||
}
|
||||
|
||||
/// If user clicks on previous to get back to the select backend, we revert the applied remote
|
||||
/// backend on the context.
|
||||
fn revert(&self, ctx: &mut Context) {
|
||||
ctx.remote_backend = None;
|
||||
}
|
||||
|
||||
fn view<'a>(
|
||||
&'a self,
|
||||
_hws: &'a HardwareWallets,
|
||||
|
||||
@ -50,6 +50,7 @@ pub trait Step {
|
||||
fn apply(&mut self, _ctx: &mut Context) -> bool {
|
||||
true
|
||||
}
|
||||
fn revert(&self, _ctx: &mut Context) {}
|
||||
fn stop(&self) {}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user