update
This commit is contained in:
@@ -61,6 +61,9 @@ impl ImportIdentity {
|
||||
let value = self.key_input.read(cx).value();
|
||||
let password = self.pass_input.read(cx).value();
|
||||
|
||||
// Set loading state
|
||||
self.set_loading(true, cx);
|
||||
|
||||
if value.starts_with("ncryptsec1") {
|
||||
self.ncryptsec(value, password, window, cx);
|
||||
return;
|
||||
@@ -86,7 +89,6 @@ impl ImportIdentity {
|
||||
nostr.update(cx, |this, cx| {
|
||||
this.set_signer(keys, cx);
|
||||
});
|
||||
window.close_modal(cx);
|
||||
} else {
|
||||
self.set_error("Invalid key", cx);
|
||||
}
|
||||
@@ -165,10 +167,17 @@ impl ImportIdentity {
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn set_loading(&mut self, status: bool, cx: &mut Context<Self>) {
|
||||
self.loading = status;
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn set_error<S>(&mut self, message: S, cx: &mut Context<Self>)
|
||||
where
|
||||
S: Into<SharedString>,
|
||||
{
|
||||
self.set_loading(false, cx);
|
||||
|
||||
// Update error message
|
||||
self.error.update(cx, |this, cx| {
|
||||
*this = Some(message.into());
|
||||
@@ -223,7 +232,7 @@ impl Render for ImportIdentity {
|
||||
this.child(
|
||||
div()
|
||||
.text_xs()
|
||||
.text_color(cx.theme().warning_active)
|
||||
.text_color(cx.theme().text_warning)
|
||||
.child(MSG),
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user