Skip to content

Commit 28aa254

Browse files
committed
feat: add update conditions to index.json
1 parent 63eb865 commit 28aa254

File tree

10 files changed

+244
-117
lines changed

10 files changed

+244
-117
lines changed

crates/fig_desktop/src/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub async fn run_install(ctx: Arc<Context>, ignore_immediate_update: bool) {
115115
use tokio::time::timeout;
116116
// Check for updates but timeout after 3 seconds to avoid making the user wait too long
117117
// todo: don't download the index file twice
118-
match timeout(Duration::from_secs(3), check_for_updates(true, true)).await {
118+
match timeout(Duration::from_secs(3), check_for_updates(true)).await {
119119
Ok(Ok(Some(_))) => {
120120
crate::update::check_for_update(true, true).await;
121121
},

crates/fig_desktop/src/tray.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ fn tray_update(proxy: &EventLoopProxy) {
9797
ignore_rollout: true,
9898
interactive: true,
9999
relaunch_dashboard: true,
100-
is_auto_update: false,
101100
},
102101
)
103102
.await;
@@ -138,7 +137,7 @@ fn tray_update(proxy: &EventLoopProxy) {
138137
///
139138
/// Returns `true` if we should continue with updating, `false` otherwise.
140139
async fn should_continue_with_update(ctx: &Context, proxy: &EventLoopProxy) -> bool {
141-
match fig_install::check_for_updates(true, false).await {
140+
match fig_install::check_for_updates(true).await {
142141
Ok(Some(pkg)) => {
143142
let file_type = get_file_type(ctx, &Variant::Full)
144143
.await

crates/fig_desktop/src/update.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ pub async fn check_for_update(show_webview: bool, relaunch_dashboard: bool) -> b
101101
ignore_rollout: false,
102102
interactive: show_webview,
103103
relaunch_dashboard,
104-
is_auto_update: true,
105104
})
106105
.await
107106
{

crates/fig_desktop_api/src/requests/update.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ pub async fn update_application(request: UpdateApplicationRequest) -> RequestRes
2020
ignore_rollout: request.ignore_rollout.unwrap_or(true),
2121
interactive: request.interactive.unwrap_or(true),
2222
relaunch_dashboard: request.relaunch_dashboard.unwrap_or(true),
23-
is_auto_update: false,
2423
},
2524
));
2625
RequestResult::success()
2726
}
2827

2928
pub async fn check_for_updates(_request: CheckForUpdatesRequest) -> RequestResult {
30-
fig_install::check_for_updates(true, false)
29+
fig_install::check_for_updates(true)
3130
.await
3231
.map(|res| {
3332
Box::new(ServerOriginatedSubMessage::CheckForUpdatesResponse(

0 commit comments

Comments
 (0)