refactor panel open flow

This commit is contained in:
2026-09-23 08:53:20 +07:00
parent 6510e45e4e
commit 7ba289440b
9 changed files with 122 additions and 191 deletions
+9 -11
View File
@@ -145,21 +145,19 @@ impl CommunityPanel {
window,
|_this, _community, event, window, cx| {
match event {
CommunityEvent::Updated(_)
| CommunityEvent::Unreadable(_)
| CommunityEvent::Failed(_) => {
cx.defer_in(window, |this, window, cx| this.reload(window, cx));
}
CommunityEvent::Channel(..) => {
cx.defer_in(window, |this, window, cx| this.load(window, cx));
cx.defer_in(window, |this, window, cx| {
this.load(window, cx);
});
}
CommunityEvent::Error(error) => {
window.push_notification(
Notification::error(error.clone()).autohide(false),
cx,
);
window.push_notification(Notification::error(error.clone()), cx);
}
_ => {
cx.defer_in(window, |this, window, cx| {
this.reload(window, cx);
});
}
CommunityEvent::Open(_) | CommunityEvent::Close(_) => {}
};
},
));