gRPC Support (#20)

This commit is contained in:
Gregory Schier
2024-02-09 05:01:00 -08:00
committed by GitHub
parent eecb3fbc7f
commit a9d99aa17f
162 changed files with 6670 additions and 1770 deletions

View File

@@ -1,8 +1,8 @@
use std::time::SystemTime;
use log::info;
use tauri::{AppHandle, updater, Window, Wry};
use tauri::api::dialog;
use tauri::{updater, AppHandle, Window};
use crate::is_dev;
@@ -27,14 +27,17 @@ impl YaakUpdater {
}
pub async fn force_check(
&mut self,
app_handle: &AppHandle<Wry>,
app_handle: &AppHandle,
mode: UpdateMode,
) -> Result<bool, updater::Error> {
self.last_update_check = SystemTime::now();
let update_mode = get_update_mode_str(mode);
let enabled = !is_dev();
info!("Checking for updates mode={} enabled={}", update_mode, enabled);
info!(
"Checking for updates mode={} enabled={}",
update_mode, enabled
);
if !enabled {
return Ok(false);
@@ -89,10 +92,11 @@ impl YaakUpdater {
}
pub async fn check(
&mut self,
app_handle: &AppHandle<Wry>,
app_handle: &AppHandle,
mode: UpdateMode,
) -> Result<bool, updater::Error> {
let ignore_check = self.last_update_check.elapsed().unwrap().as_secs() < MAX_UPDATE_CHECK_SECONDS;
let ignore_check =
self.last_update_check.elapsed().unwrap().as_secs() < MAX_UPDATE_CHECK_SECONDS;
if ignore_check {
return Ok(false);
}