Move settings subscription to dock
Reduces likelihood of panels being unable to move themselves
This commit is contained in:
parent
fee369bca1
commit
898645681f
6 changed files with 13 additions and 62 deletions
|
@ -127,17 +127,6 @@ impl ChatPanel {
|
|||
open_context_menu: None,
|
||||
};
|
||||
|
||||
let mut old_dock_position = this.position(cx);
|
||||
this.subscriptions.push(cx.observe_global::<SettingsStore>(
|
||||
move |this: &mut Self, cx| {
|
||||
let new_dock_position = this.position(cx);
|
||||
if new_dock_position != old_dock_position {
|
||||
old_dock_position = new_dock_position;
|
||||
cx.emit(PanelEvent::ChangePosition);
|
||||
}
|
||||
cx.notify();
|
||||
},
|
||||
));
|
||||
this.subscriptions.push(cx.subscribe(
|
||||
&ActiveCall::global(cx),
|
||||
move |this: &mut Self, call, event: &room::Event, cx| match event {
|
||||
|
|
|
@ -254,19 +254,6 @@ impl CollabPanel {
|
|||
|
||||
this.update_entries(false, cx);
|
||||
|
||||
// Update the dock position when the setting changes.
|
||||
let mut old_dock_position = this.position(cx);
|
||||
this.subscriptions.push(cx.observe_global::<SettingsStore>(
|
||||
move |this: &mut Self, cx| {
|
||||
let new_dock_position = this.position(cx);
|
||||
if new_dock_position != old_dock_position {
|
||||
old_dock_position = new_dock_position;
|
||||
cx.emit(PanelEvent::ChangePosition);
|
||||
}
|
||||
cx.notify();
|
||||
},
|
||||
));
|
||||
|
||||
let active_call = ActiveCall::global(cx);
|
||||
this.subscriptions
|
||||
.push(cx.observe(&this.user_store, |this, _, cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue