Skip to content

Commit d67c144

Browse files
committed
refactor: gate updater feature in build configuration and clean up about modal UI
1 parent d462c78 commit d67c144

8 files changed

Lines changed: 17 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1212
- **PowerShell**: Added PowerShell 7+ (pwsh) support for mount plugin installer. If pwsh is not available on Windows, default to Windows PowerShell (powershell.exe). #229
1313

1414
### Changed
15-
-
15+
- **Updater Feature**: Gate the application and Rclone update system behind "updater" feature.
1616

1717
### Fixed
1818
- Detached dialog and other dialog fixes. #228

src-tauri/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ tauri-plugin-autostart = "2"
9494
tauri-plugin-single-instance = "2"
9595

9696
[features]
97-
web-server = ["axum", "tower-http", "async-stream", "axum-server", "anyhow"]
97+
updater = ["dep:tauri-plugin-updater"]
98+
99+
web-server = ["axum", "tower-http", "async-stream", "axum-server", "anyhow", "updater"]
98100

99101
# Container
100102
container = ["web-server"]
101103

102-
updater = ["dep:tauri-plugin-updater"]
103-
104104
# For GUI features
105-
default = ["desktop", "tray", "updater"]
106-
desktop = ["tauri-plugin-shell", "tauri-plugin-window-state", "tauri-plugin-dialog", "tauri/devtools", "tauri-plugin-clipboard-manager"]
105+
desktop = ["tauri-plugin-shell", "tauri-plugin-window-state", "tauri-plugin-dialog", "tauri/devtools", "tauri-plugin-clipboard-manager", "updater"]
107106
tray = ["tauri/tray-icon", "tauri/image-png"]
107+
default = ["desktop", "tray"]
108108

109109
# Managed by package managers or not compatible with updater
110110
portable = ["desktop", "tray"]

src-tauri/src/core/lifecycle/shutdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub async fn handle_shutdown(app_handle: AppHandle) {
5050
),
5151
);
5252

53-
#[cfg(desktop)]
53+
#[cfg(feature = "updater")]
5454
crate::core::lifecycle::auto_updater::stop_auto_updater(&app_handle);
5555

5656
match scheduler_state.stop().await {

src-tauri/src/rclone/engine/lifecycle.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,21 @@ impl RcApiEngine {
4141
}
4242
}
4343

44+
#[cfg(feature = "updater")]
4445
pub async fn set_engine_updating(app: &AppHandle, updating: bool) {
4546
let state = app.state::<EngineState>();
4647
let mut engine = state.lock().await;
4748
engine.set_updating(updating);
4849
}
4950

51+
#[cfg(feature = "updater")]
5052
pub async fn shutdown_engine(app: &AppHandle) {
5153
let state = app.state::<EngineState>();
5254
let mut engine = state.lock().await;
5355
engine.shutdown(app).await;
5456
}
5557

58+
#[cfg(feature = "updater")]
5659
pub async fn resume_engine(app: &AppHandle) {
5760
let state = app.state::<EngineState>();
5861
let mut engine = state.lock().await;

src-tauri/src/utils/app/updater.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pub mod app_updates {
22
use crate::core::{lifecycle::shutdown::handle_shutdown, settings::AppSettingsManager};
3-
use crate::utils::app::platform::relaunch_app;
43
use crate::utils::github_client::{OWNER, REPO};
54
use crate::utils::types::{
65
events::APP_EVENT,
@@ -414,7 +413,7 @@ pub mod app_updates {
414413
}),
415414
);
416415
app.state::<AppUpdaterState>().data.lock().state = UpdateState::Idle;
417-
if let Err(e) = relaunch_app(app).await {
416+
if let Err(e) = crate::utils::app::platform::relaunch_app(app).await {
418417
log::error!("Failed to relaunch app: {e}");
419418
}
420419
});

src-tauri/tauri.conf.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"resources/serve-template.html": "serve-template.html"
4646
},
4747
"createUpdaterArtifacts": true,
48-
"targets": ["nsis", "msi", "dmg", "app", "deb", "rpm", "appimage"],
4948
"category": "Utility",
5049
"shortDescription": "User-friendly GUI for RClone",
5150
"homepage": "https://github.com/Zarestia-Dev/rclone-manager",

src/app/features/modals/settings/about-modal/about-modal.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ <h2 class="app-name">RClone Manager</h2>
163163
<div class="rclone-identity">
164164
<span class="rclone-name">RClone Manager</span>
165165
<span class="rclone-version">{{ rCloneManagerVersion }}</span>
166-
@if (buildType()) {
167-
<span class="channel-badge stable">
168-
{{ getChannelLabel(buildType()) | translate }}
169-
</span>
170-
}
171166
</div>
172167
</div>
173168

src/app/features/modals/settings/about-modal/about-modal.component.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,21 +218,20 @@
218218

219219
.channel-badge {
220220
flex-shrink: 0;
221-
padding: 1px var(--space-sm);
221+
padding: 2px var(--space-sm);
222222
border-radius: var(--radius-sm);
223223
font-size: var(--font-size-xs);
224224
font-weight: 700;
225-
letter-spacing: 0.04em;
225+
226+
&.stable {
227+
background: rgba(var(--primary-color-rgb), 0.12);
228+
color: var(--primary-color);
229+
}
226230

227231
&.beta {
228232
background: rgba(var(--orange-rgb), 0.12);
229233
color: var(--orange);
230234
}
231-
232-
&.dev {
233-
background: rgba(var(--accent-color-rgb), 0.12);
234-
color: var(--accent-color);
235-
}
236235
}
237236
}
238237
}

0 commit comments

Comments
 (0)