wip: release candidate #34

Draft
reya wants to merge 12 commits from feat/rc into master
4 changed files with 84 additions and 79 deletions
Showing only changes of commit 2d3d90774c - Show all commits

View File

@@ -620,13 +620,19 @@ impl ChatPanel {
}) })
.is_err() .is_err()
{ {
window.push_notification( window.push_notification(Notification::error("Failed to change subject"), cx);
Notification::error("Failed to change subject").autohide(false),
cx,
);
} }
} }
Command::ChangeSigner(kind) => { 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 if self
.room .room
.update(cx, |this, cx| { .update(cx, |this, cx| {
@@ -634,10 +640,7 @@ impl ChatPanel {
}) })
.is_err() .is_err()
{ {
window.push_notification( window.push_notification(Notification::error("Failed to change signer"), cx);
Notification::error("Failed to change signer").autohide(false),
cx,
);
} }
} }
Command::ToggleBackup => { Command::ToggleBackup => {
@@ -648,10 +651,7 @@ impl ChatPanel {
}) })
.is_err() .is_err()
{ {
window.push_notification( window.push_notification(Notification::error("Failed to toggle backup"), cx);
Notification::error("Failed to toggle backup").autohide(false),
cx,
);
} }
} }
Command::Copy(public_key) => { Command::Copy(public_key) => {

View File

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

View File

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

View File

@@ -641,6 +641,7 @@ impl Workspace {
let chat = ChatRegistry::global(cx); let chat = ChatRegistry::global(cx);
let initializing = chat.read(cx).initializing; let initializing = chat.read(cx).initializing;
let trash_messages = chat.read(cx).count_trash_messages(cx); let trash_messages = chat.read(cx).count_trash_messages(cx);
let is_nip4e_enabled = AppSettings::get_encryption_key(cx);
let device = DeviceRegistry::global(cx); let device = DeviceRegistry::global(cx);
let device_initializing = device.read(cx).initializing; let device_initializing = device.read(cx).initializing;
@@ -691,7 +692,8 @@ impl Workspace {
}), }),
) )
}) })
.child( .when(is_nip4e_enabled, |this| {
this.child(
Button::new("key") Button::new("key")
.icon(IconName::UserKey) .icon(IconName::UserKey)
.tooltip("Decoupled encryption key") .tooltip("Decoupled encryption key")
@@ -721,7 +723,8 @@ impl Workspace {
) )
.child(name.clone()) .child(name.clone())
})) }))
.item(PopupMenuItem::element(move |_window, cx| { .item(
PopupMenuItem::element(move |_window, cx| {
h_flex() h_flex()
.gap_1() .gap_1()
.text_sm() .text_sm()
@@ -731,7 +734,8 @@ impl Workspace {
.text_color(cx.theme().icon_muted), .text_color(cx.theme().icon_muted),
) )
.child(SharedString::from(pkey.clone())) .child(SharedString::from(pkey.clone()))
})) }),
)
}) })
.separator() .separator()
.menu_with_icon( .menu_with_icon(
@@ -757,6 +761,7 @@ impl Workspace {
) )
}), }),
) )
})
.child( .child(
Button::new("inbox") Button::new("inbox")
.icon(IconName::Inbox) .icon(IconName::Inbox)