This commit is contained in:
2026-07-23 16:12:36 +07:00
parent bf6ae65b05
commit 40166fd071
5 changed files with 129 additions and 85 deletions

View File

@@ -81,6 +81,17 @@ impl Workspace {
let mut subscriptions = smallvec![];
subscriptions.push(
// Observe sign in state changes
cx.observe_in(&nostr, window, move |this, nostr, window, cx| {
if nostr.read(cx).current_user().is_some() {
this.set_center_layout(window, cx);
} else {
this.import_identity(window, cx);
}
}),
);
subscriptions.push(
// Observe system appearance and update theme
cx.observe_window_appearance(window, |_this, window, cx| {
@@ -90,7 +101,7 @@ impl Workspace {
subscriptions.push(
// Subscribe to the nostr events
cx.subscribe_in(&nostr, window, move |_this, _state, event, window, cx| {
cx.subscribe_in(&nostr, window, move |this, _state, event, window, cx| {
match event {
StateEvent::Connecting => {
let note = Notification::new()
@@ -108,6 +119,10 @@ impl Workspace {
window.push_notification(note, cx);
}
StateEvent::SignerChanged => {
this.set_center_layout(window, cx);
window.close_all_modals(cx);
}
_ => {}
};
}),

View File

@@ -462,7 +462,7 @@ impl Sidebar {
});
RoomEntry::new(range.start + ix)
.name(profile.name())
.name(profile.name().trim())
.avatar(profile.avatar())
.on_click(handler)
.selected(selected)