mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:09:41 +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:
@@ -29,6 +29,7 @@ tracing.workspace = true
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-notification = "2"
|
||||
tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
|
||||
tauri-plugin-deep-link = "2"
|
||||
rusqlite = { version = "0.37", features = ["bundled"] }
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"opener:default",
|
||||
"deep-link:default",
|
||||
"core:webview:allow-create-webview-window",
|
||||
"core:window:allow-set-title"
|
||||
"core:window:allow-set-title",
|
||||
"notification:default"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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