refactor panel open flow
This commit is contained in:
@@ -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(_) => {}
|
||||
};
|
||||
},
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user