chore: clean up current dock when logout

This commit is contained in:
2025-05-03 08:39:17 +07:00
parent 8c211be11a
commit 3bd8592f86
2 changed files with 9 additions and 0 deletions

View File

@@ -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);
});
}

View File

@@ -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;