Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

cargo feature gate applying update (#2969)

Sean Aye07016b966b5c
diff --git a/js/app/tauri/src-tauri/Cargo.toml b/js/app/tauri/src-tauri/Cargo.toml
index 171bc8ccb9..6fdae7b8bd 100644
--- a/js/app/tauri/src-tauri/Cargo.toml
+++ b/js/app/tauri/src-tauri/Cargo.toml
@@ -17,7 +17,8 @@ name = "app_lib"
tauri-build = { version = "2.3.1", features = [] }
[features]
-default = []
+auto_apply_update = []
+default = ["auto_apply_update"]
[dependencies]
http = "1"
@@ -30,13 +31,13 @@ serde_json = "1.0"
tracing-oslog = { version = "0.3" }
nom = "8.0.0"
-reqwest = { workspace = true, features = [
- "cookies",
-] }
+reqwest = { workspace = true, features = ["cookies"] }
serde_qs = "0.15.0"
tauri = { workspace = true, features = [] }
tauri-plugin-deep-link = "=2.4.5"
-tauri-plugin-http = { git = "https://github.com/seanaye/plugins-workspace", branch = "seanaye/feat/websocket-cookies", features = ["unsafe-headers"] }
+tauri-plugin-http = { git = "https://github.com/seanaye/plugins-workspace", branch = "seanaye/feat/websocket-cookies", features = [
+ "unsafe-headers",
+] }
tauri-plugin-log = { version = "2", features = ["tracing"] }
tauri-plugin-opener = "2"
tauri-plugin-safe-area-insets = "0.1.0"
@@ -52,9 +53,9 @@ tauri-plugin-notification = "2"
# push notifications for mobile (when app is closed)
macro_bundle_updater_plugin = { path = "../macro_bundle_updater_plugin" }
navigation_plugin = { path = "../navigation_plugin" }
+tauri-plugin-device-info = "1.0.1"
tauri-plugin-notifications = { git = "https://github.com/macro-inc/tauri-plugins", rev = "61520093d5c7fcd60a2ed354dc150ca9556519a4" }
tauri-plugin-os = "2"
-tauri-plugin-device-info = "1.0.1"
tauri-plugin-virtual-keyboard = { git = "https://github.com/voxelbee/tauri-plugin-virtual-keyboard", branch = "main" }
@@ -62,8 +63,8 @@ tauri-plugin-virtual-keyboard = { git = "https://github.com/voxelbee/tauri-plugi
tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
-tauri-plugin-haptics = "2"
tauri-plugin-auth = { git = "https://github.com/macro-inc/tauri-plugins", rev = "61520093d5c7fcd60a2ed354dc150ca9556519a4" }
+tauri-plugin-haptics = "2"
[target.'cfg(target_os = "ios")'.dependencies]
tauri-plugin-input-accessory = { path = "../input_accessory_plugin" }
diff --git a/js/app/tauri/src-tauri/src/lib.rs b/js/app/tauri/src-tauri/src/lib.rs
index 93176151ea..2dfb274be4 100644
--- a/js/app/tauri/src-tauri/src/lib.rs
+++ b/js/app/tauri/src-tauri/src/lib.rs
@@ -209,19 +209,22 @@ pub fn run() {
.build(tauri::generate_context!())
.expect("error while building tauri application")
.run(|app_handle, event| {
- if let RunEvent::Resumed = event {
- let app = app_handle.clone();
- tauri::async_runtime::spawn(async move {
- match apply_completed_update(&app).await {
- Ok(true) => {
- tracing::info!("auto-applied pending bundle update on foreground");
- }
- Ok(false) => {}
- Err(e) => {
- tracing::error!("failed to auto-apply bundle update: {e}");
+ #[cfg(feature = "auto_apply_update")]
+ {
+ if let RunEvent::Resumed = event {
+ let app = app_handle.clone();
+ tauri::async_runtime::spawn(async move {
+ match apply_completed_update(&app).await {
+ Ok(true) => {
+ tracing::info!("auto-applied pending bundle update on foreground");
+ }
+ Ok(false) => {}
+ Err(e) => {
+ tracing::error!("failed to auto-apply bundle update: {e}");
+ }
}
- }
- });
+ });
+ }
}
});
}