fix: read version from tauri.conf.json, not CARGO_PKG_VERSION
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Has been cancelled
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Has been cancelled
CARGO_PKG_VERSION is always 0.1.0 (hardcoded in Cargo.toml). CI patches tauri.conf.json from the git tag. Now reads app_handle.config() for the real version so the update checker compares correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4b26d9190b
commit
c1f8d2a14d
@ -14,8 +14,10 @@ pub struct UpdateInfo {
|
||||
|
||||
/// Check Gitea for the latest release and compare with current version.
|
||||
#[tauri::command]
|
||||
pub async fn check_for_updates() -> Result<UpdateInfo, String> {
|
||||
let current = env!("CARGO_PKG_VERSION").to_string();
|
||||
pub async fn check_for_updates(app_handle: tauri::AppHandle) -> Result<UpdateInfo, String> {
|
||||
// Read version from tauri.conf.json (patched by CI from git tag)
|
||||
// rather than CARGO_PKG_VERSION which is always 0.1.0
|
||||
let current = app_handle.config().version.clone().unwrap_or_else(|| "0.0.0".to_string());
|
||||
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(std::time::Duration::from_secs(10))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user