chore: clean up current dock when logout
This commit is contained in:
@@ -129,6 +129,7 @@ impl ChatSpace {
|
||||
let center = DockItem::panel(panel);
|
||||
|
||||
self.dock.update(cx, |this, cx| {
|
||||
this.reset(window, cx);
|
||||
this.set_center(center, window, cx);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -390,6 +390,14 @@ impl DockArea {
|
||||
self.update_toggle_button_tab_panels(window, cx);
|
||||
}
|
||||
|
||||
/// Reset all docks
|
||||
pub fn reset(&mut self, _window: &mut Window, cx: &mut Context<Self>) {
|
||||
self.left_dock = None;
|
||||
self.right_dock = None;
|
||||
self.bottom_dock = None;
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
/// Set locked state of the dock area, if locked, the dock area cannot be split or move, but allows to resize panels.
|
||||
pub fn set_locked(&mut self, locked: bool, _window: &mut Window, _cx: &mut App) {
|
||||
self.is_locked = locked;
|
||||
|
||||
Reference in New Issue
Block a user