mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-25 03:16:01 +00:00
Notify ActivityIndicator
when AutoUpdater
changes
This fixes a bug that caused the status bar to not update when the auto-update system changed its status.
This commit is contained in:
parent
23d7143298
commit
6bdbab2faf
1 changed files with 5 additions and 1 deletions
|
@ -46,6 +46,7 @@ impl ActivityIndicator {
|
||||||
cx: &mut ViewContext<Workspace>,
|
cx: &mut ViewContext<Workspace>,
|
||||||
) -> ViewHandle<ActivityIndicator> {
|
) -> ViewHandle<ActivityIndicator> {
|
||||||
let project = workspace.project().clone();
|
let project = workspace.project().clone();
|
||||||
|
let auto_updater = AutoUpdater::get(cx);
|
||||||
let this = cx.add_view(|cx: &mut ViewContext<Self>| {
|
let this = cx.add_view(|cx: &mut ViewContext<Self>| {
|
||||||
let mut status_events = languages.language_server_binary_statuses();
|
let mut status_events = languages.language_server_binary_statuses();
|
||||||
cx.spawn_weak(|this, mut cx| async move {
|
cx.spawn_weak(|this, mut cx| async move {
|
||||||
|
@ -66,11 +67,14 @@ impl ActivityIndicator {
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
cx.observe(&project, |_, _, cx| cx.notify()).detach();
|
cx.observe(&project, |_, _, cx| cx.notify()).detach();
|
||||||
|
if let Some(auto_updater) = auto_updater.as_ref() {
|
||||||
|
cx.observe(auto_updater, |_, _, cx| cx.notify()).detach();
|
||||||
|
}
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
statuses: Default::default(),
|
statuses: Default::default(),
|
||||||
project: project.clone(),
|
project: project.clone(),
|
||||||
auto_updater: AutoUpdater::get(cx),
|
auto_updater,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cx.subscribe(&this, move |workspace, _, event, cx| match event {
|
cx.subscribe(&this, move |workspace, _, event, cx| match event {
|
||||||
|
|
Loading…
Reference in a new issue