feat #14740: check for updates from the settings
Adds a "Nach Updates suchen" button to the settings' new Updates section, next to the app's own version. It runs check_for_update_now, the very same feed check the background loop uses (one implementation, shared via UpdateSchedule), so a manual check counts as an attempt for the same scheduler: success resets the 6 h interval and the failure count, a failure advances the backoff by one step, and a manual and a background check never run at the same time (serialized). An available update leaves the same state the background check does, so the main window's banner still shows it; the settings also show it inline with the existing "Installieren & neu starten" button and busy guard/hint. "None" and "error" results are shown inline (unlike the background check, which never surfaces its errors). On Linux (can_self_update) the button still asks the feed but offers no install, since Debian builds never self-update. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ use tauri_plugin_autostart::MacosLauncher;
|
||||
use tauri_plugin_log::{RotationStrategy, Target, TargetKind, TimezoneStrategy};
|
||||
|
||||
use crate::state::AppState;
|
||||
use crate::updater::PendingUpdate;
|
||||
use crate::updater::{PendingUpdate, UpdateSchedule};
|
||||
|
||||
/// Command-line flag the login item starts the app with; the main window
|
||||
/// then stays hidden in the tray.
|
||||
@@ -98,6 +98,7 @@ pub fn run() {
|
||||
processing::clear_upload_dir(app.handle());
|
||||
app.manage(state);
|
||||
app.manage(PendingUpdate::default());
|
||||
app.manage(UpdateSchedule::default());
|
||||
app.manage(backend::LoginWaiters::default());
|
||||
// Windows are created here (`create: false` in tauri.conf.json)
|
||||
// instead of by Tauri before `setup` runs: their webviews load
|
||||
@@ -130,6 +131,7 @@ pub fn run() {
|
||||
}
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::get_app_version,
|
||||
commands::get_settings,
|
||||
commands::save_settings,
|
||||
commands::set_api_key,
|
||||
@@ -160,6 +162,8 @@ pub fn run() {
|
||||
backend::upload_transcript,
|
||||
updater::get_update,
|
||||
updater::install_update,
|
||||
updater::check_for_update_now,
|
||||
updater::can_self_update,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while building tauri application");
|
||||
|
||||
Reference in New Issue
Block a user