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) => {

View File

@@ -67,8 +67,8 @@ impl Display for AuthMode {
/// Signer kind
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub enum SignerKind {
#[default]
Auto,
#[default]
User,
Encryption,
}

View File

@@ -18,7 +18,7 @@ pub(crate) fn input_style(disabled: bool, cx: &App) -> (Hsla, Hsla) {
if disabled {
(cx.theme().surface_background, cx.theme().text_muted)
} else {
(cx.theme().surface_background, cx.theme().text)
(cx.theme().elevated_surface_background, cx.theme().text)
}
}