warnings on metadata page, why you cant edit/save

This commit is contained in:
Mike Dilger 2023-02-16 17:08:12 +13:00
parent 58249e61fc
commit 11c6dadb63

View File

@ -110,7 +110,28 @@ pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Fr
.to_overlord
.send(ToOverlordMessage::PushMetadata(app.metadata.clone()));
}
} else if GLOBALS.signer.is_ready() && ui.button("EDIT").clicked() {
} else if !GLOBALS.signer.is_ready() {
ui.horizontal(|ui| {
ui.label("You need to");
if ui.link("unlock your private key").clicked() {
app.set_page(Page::YourKeys);
}
ui.label("to edit/save metadata.");
});
} else if !GLOBALS
.relay_tracker
.all_relays
.iter()
.any(|r| r.value().write)
{
ui.horizontal(|ui| {
ui.label("You need to");
if ui.link("configure write relays").clicked() {
app.set_page(Page::RelaysAll);
}
ui.label("to edit/save metadata.");
});
} else if ui.button("EDIT").clicked() {
app.editing_metadata = true;
app.metadata = view_metadata.to_owned();
}