mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:29:40 +01:00
Opt-in update notices
- Asked once after the first start; switch and Check now in Settings - At most one request a day to GitHub's latest-release endpoint, nothing else is sent; knock never updates itself - A new version shows a notice with download link and release notes, plus one desktop notification per version; versions can be skipped
This commit is contained in:
@@ -794,3 +794,9 @@ pub async fn code_snippet(app: AppHandle, args: ScopeArgs, lang: knock_core::exp
|
||||
};
|
||||
Ok(knock_core::export::snippet(&p, lang))
|
||||
}
|
||||
|
||||
/// Latest release on GitHub. Only called when the user opted in.
|
||||
#[tauri::command]
|
||||
pub async fn update_check() -> Res<knock_core::update::Release> {
|
||||
knock_core::update::latest(env!("CARGO_PKG_VERSION")).await.map_err(errx)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_deep_link::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.plugin(tauri_plugin_notification::init())
|
||||
.setup(|app| {
|
||||
let dir = app.path().app_data_dir()?;
|
||||
app.manage(state::AppState::new(dir)?);
|
||||
@@ -70,6 +71,7 @@ pub fn run() {
|
||||
commands::path_params,
|
||||
commands::app_version,
|
||||
commands::write_text_file,
|
||||
commands::update_check,
|
||||
commands::runner_run,
|
||||
commands::import_curl,
|
||||
commands::import_detect,
|
||||
|
||||
Reference in New Issue
Block a user