mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-22 11:56:22 +02:00
chore: linting
This commit is contained in:
@@ -45,15 +45,6 @@ impl AutoUpdater {
|
||||
pub async fn check_for_updates(
|
||||
&self,
|
||||
) -> Result<Vec<UpdateNotification>, Box<dyn std::error::Error + Send + Sync>> {
|
||||
// Check if auto-updates are enabled
|
||||
let settings = self
|
||||
.settings_manager
|
||||
.load_settings()
|
||||
.map_err(|e| format!("Failed to load settings: {e}"))?;
|
||||
if !settings.auto_updates_enabled {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
let mut notifications = Vec::new();
|
||||
let mut browser_versions: HashMap<String, Vec<BrowserVersionInfo>> = HashMap::new();
|
||||
|
||||
|
||||
@@ -2618,6 +2618,26 @@ pub async fn download_browser(
|
||||
Ok(version)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn is_browser_downloaded(browser_str: String, version: String) -> bool {
|
||||
if let Ok(registry) = DownloadedBrowsersRegistry::load() {
|
||||
if registry.is_browser_downloaded(&browser_str, &version) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
let browser_type = BrowserType::from_str(&browser_str).expect("Invalid browser type");
|
||||
let browser_runner = BrowserRunner::new();
|
||||
let browser = create_browser(browser_type.clone());
|
||||
let binaries_dir = browser_runner.get_binaries_dir();
|
||||
browser.is_version_downloaded(&version, &binaries_dir)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn check_browser_exists(browser_str: String, version: String) -> bool {
|
||||
// This is an alias for is_browser_downloaded to provide clearer semantics for auto-updates
|
||||
is_browser_downloaded(browser_str, version)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn kill_browser_profile(
|
||||
app_handle: tauri::AppHandle,
|
||||
|
||||
@@ -25,11 +25,11 @@ impl Default for TableSortingSettings {
|
||||
pub struct AppSettings {
|
||||
#[serde(default)]
|
||||
pub set_as_default_browser: bool,
|
||||
#[serde(default = "default_show_settings_on_startup")]
|
||||
#[serde(default)]
|
||||
pub show_settings_on_startup: bool,
|
||||
#[serde(default = "default_theme")]
|
||||
pub theme: String, // "light", "dark", or "system"
|
||||
#[serde(default = "default_auto_delete_unused_binaries")]
|
||||
#[serde(default)]
|
||||
pub auto_delete_unused_binaries: bool,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user