Display Installing update…
when the new app is being copied
This commit is contained in:
parent
61c479ebc8
commit
bd0b063bd1
1 changed files with 12 additions and 1 deletions
|
@ -30,6 +30,7 @@ pub enum AutoUpdateStatus {
|
||||||
Idle,
|
Idle,
|
||||||
Checking,
|
Checking,
|
||||||
Downloading,
|
Downloading,
|
||||||
|
Installing,
|
||||||
Updated,
|
Updated,
|
||||||
Errored,
|
Errored,
|
||||||
}
|
}
|
||||||
|
@ -175,6 +176,11 @@ impl AutoUpdater {
|
||||||
smol::io::copy(response.bytes(), &mut dmg_file).await?;
|
smol::io::copy(response.bytes(), &mut dmg_file).await?;
|
||||||
log::info!("downloaded update. path:{:?}", dmg_path);
|
log::info!("downloaded update. path:{:?}", dmg_path);
|
||||||
|
|
||||||
|
this.update(&mut cx, |this, cx| {
|
||||||
|
this.status = AutoUpdateStatus::Installing;
|
||||||
|
cx.notify();
|
||||||
|
});
|
||||||
|
|
||||||
let output = Command::new("hdiutil")
|
let output = Command::new("hdiutil")
|
||||||
.args(&["attach", "-nobrowse"])
|
.args(&["attach", "-nobrowse"])
|
||||||
.arg(&dmg_path)
|
.arg(&dmg_path)
|
||||||
|
@ -215,7 +221,7 @@ impl AutoUpdater {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.status = AutoUpdateStatus::Idle;
|
this.status = AutoUpdateStatus::Updated;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -245,6 +251,11 @@ impl View for AutoUpdateIndicator {
|
||||||
theme.auto_update_progress_message.clone(),
|
theme.auto_update_progress_message.clone(),
|
||||||
)
|
)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
|
AutoUpdateStatus::Installing => Text::new(
|
||||||
|
"Installing update…".to_string(),
|
||||||
|
theme.auto_update_done_message.clone(),
|
||||||
|
)
|
||||||
|
.boxed(),
|
||||||
AutoUpdateStatus::Updated => Text::new(
|
AutoUpdateStatus::Updated => Text::new(
|
||||||
"Restart to update Zed".to_string(),
|
"Restart to update Zed".to_string(),
|
||||||
theme.auto_update_done_message.clone(),
|
theme.auto_update_done_message.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue