Merge #1718: Clear descriptor cache
a51704fcc66fcfa7e5bc133eaf2f7c406ee19e8b installer: let user reset the descriptor template (pythcoiner) Pull request description: closes #1715    ACKs for top commit: jp1ac4: tACK a51704fcc66fcfa7e5bc133eaf2f7c406ee19e8b. Tree-SHA512: 6d47dea9893999f0b3e15bc1a78e30a29dc6ce0a4551ac637d02dff435c14f16cdd0188e49e52512e59f934ad9dcde4a20649e87fd874f7a19f7dc477c2b63b3
This commit is contained in:
commit
bd72e318d1
@ -165,6 +165,7 @@ pub enum DefineDescriptor {
|
||||
AddSafetyNetPath,
|
||||
KeyModal(ImportKeyModal),
|
||||
ThresholdSequenceModal(ThresholdSequenceModal),
|
||||
Reset,
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
|
||||
@ -218,6 +218,12 @@ impl Step for DefineDescriptor {
|
||||
self.modal = Some(Box::new(modal));
|
||||
return cmd;
|
||||
}
|
||||
Message::DefineDescriptor(message::DefineDescriptor::Reset) => {
|
||||
self.keys.clear();
|
||||
self.paths.clear();
|
||||
self.load_template(self.descriptor_template);
|
||||
self.modal = None;
|
||||
}
|
||||
Message::DefineDescriptor(message::DefineDescriptor::Path(i, msg)) => {
|
||||
match msg {
|
||||
message::DefinePath::SequenceEdited(seq) => {
|
||||
|
||||
@ -253,12 +253,20 @@ pub fn custom_template<'a>(
|
||||
Message::DefineDescriptor(message::DefineDescriptor::Path(sn_index + 1, msg))
|
||||
})
|
||||
}))
|
||||
.push(Space::with_height(10))
|
||||
.push(
|
||||
Row::new().push(Space::with_width(Length::Fill)).push(
|
||||
button::primary(None, "Continue")
|
||||
.width(Length::Fixed(200.0))
|
||||
.on_press_maybe(if valid { Some(Message::Next) } else { None }),
|
||||
),
|
||||
Row::new()
|
||||
.push(
|
||||
button::secondary(None, "Clear All")
|
||||
.width(Length::Fixed(200.0))
|
||||
.on_press(Message::DefineDescriptor(message::DefineDescriptor::Reset)),
|
||||
)
|
||||
.push(Space::with_width(Length::Fill))
|
||||
.push(
|
||||
button::primary(None, "Continue")
|
||||
.width(Length::Fixed(200.0))
|
||||
.on_press_maybe(if valid { Some(Message::Next) } else { None }),
|
||||
),
|
||||
)
|
||||
.push(Space::with_height(100.0))
|
||||
.spacing(20),
|
||||
|
||||
@ -160,11 +160,18 @@ pub fn inheritance_template<'a>(
|
||||
)
|
||||
.map(|msg| Message::DefineDescriptor(message::DefineDescriptor::Path(1, msg))),
|
||||
)
|
||||
.push(Space::with_height(10))
|
||||
.push(
|
||||
Row::new()
|
||||
.push(
|
||||
button::secondary(None, "Clear All")
|
||||
.width(Length::Fixed(120.0))
|
||||
.on_press(Message::DefineDescriptor(message::DefineDescriptor::Reset)),
|
||||
)
|
||||
.push(Space::with_width(40))
|
||||
.push(
|
||||
button::secondary(None, "Customize")
|
||||
.width(Length::Fixed(200.0))
|
||||
.width(Length::Fixed(120.0))
|
||||
.on_press(Message::DefineDescriptor(
|
||||
message::DefineDescriptor::ChangeTemplate(
|
||||
context::DescriptorTemplate::Custom,
|
||||
|
||||
@ -230,11 +230,18 @@ pub fn multisig_security_template<'a>(
|
||||
}
|
||||
}),
|
||||
)
|
||||
.push(Space::with_height(10))
|
||||
.push(
|
||||
Row::new()
|
||||
.push(
|
||||
button::secondary(None, "Clear All")
|
||||
.width(Length::Fixed(120.0))
|
||||
.on_press(Message::DefineDescriptor(message::DefineDescriptor::Reset)),
|
||||
)
|
||||
.push(Space::with_width(40))
|
||||
.push(
|
||||
button::secondary(None, "Customize")
|
||||
.width(Length::Fixed(200.0))
|
||||
.width(Length::Fixed(120.0))
|
||||
.on_press(Message::DefineDescriptor(
|
||||
message::DefineDescriptor::ChangeTemplate(
|
||||
context::DescriptorTemplate::Custom,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user