update sidebar for onboarding

This commit is contained in:
2026-09-20 08:35:45 +07:00
parent 974f8302a1
commit 8401628412
6 changed files with 142 additions and 34 deletions
+4 -24
View File
@@ -24,7 +24,6 @@ use ui::menu::{DropdownMenu, PopupMenuItem};
use ui::notification::{Notification, NotificationKind};
use ui::{Icon, IconName, Root, Sizable, WindowExtension, h_flex, v_flex};
use crate::dialogs::import::ImportIdentity;
use crate::dialogs::restore::RestoreEncryption;
use crate::dialogs::{new_chat, new_community, settings};
use crate::panels::{
@@ -97,16 +96,10 @@ impl Workspace {
subscriptions.push(
// Subscribe to the nostr events
cx.subscribe_in(&nostr, window, move |this, _state, event, window, cx| {
match event {
StateEvent::SignerChanged => {
window.close_all_modals(cx);
}
StateEvent::NoSigner => {
this.import_identity(window, cx);
}
_ => {}
};
cx.subscribe_in(&nostr, window, move |_this, _state, event, window, cx| {
if let StateEvent::SignerChanged = event {
window.close_all_modals(cx);
}
}),
);
@@ -463,19 +456,6 @@ impl Workspace {
});
}
fn import_identity(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let import = cx.new(|cx| ImportIdentity::new(window, cx));
window.open_modal(cx, move |this, _window, _cx| {
this.width(px(450.))
.show_close(false)
.overlay_closable(false)
.keyboard(false)
.title("Onboarding")
.child(import.clone())
});
}
fn theme_selector(&mut self, window: &mut Window, cx: &mut Context<Self>) {
window.open_modal(cx, move |this, _window, cx| {
let registry = ThemeRegistry::global(cx);