make the nip4e optional

This commit is contained in:
2026-06-05 08:21:25 +07:00
parent ef227032bb
commit 2d3d90774c
4 changed files with 84 additions and 79 deletions

View File

@@ -620,13 +620,19 @@ impl ChatPanel {
})
.is_err()
{
window.push_notification(
Notification::error("Failed to change subject").autohide(false),
cx,
);
window.push_notification(Notification::error("Failed to change subject"), cx);
}
}
Command::ChangeSigner(kind) => {
let is_nip4e_enabled = AppSettings::get_encryption_key(cx);
if !is_nip4e_enabled
&& (*kind == SignerKind::Encryption || *kind == SignerKind::Auto)
{
window.push_notification("Decoupling Encryption Key is not enabled", cx);
return;
}
if self
.room
.update(cx, |this, cx| {
@@ -634,10 +640,7 @@ impl ChatPanel {
})
.is_err()
{
window.push_notification(
Notification::error("Failed to change signer").autohide(false),
cx,
);
window.push_notification(Notification::error("Failed to change signer"), cx);
}
}
Command::ToggleBackup => {
@@ -648,10 +651,7 @@ impl ChatPanel {
})
.is_err()
{
window.push_notification(
Notification::error("Failed to toggle backup").autohide(false),
cx,
);
window.push_notification(Notification::error("Failed to toggle backup"), cx);
}
}
Command::Copy(public_key) => {