chore(errors): Moved autostart commands to autostart.rs

This commit is contained in:
quexeky
2025-01-13 19:32:52 +11:00
parent 5581c8141e
commit 09ecc4216a
3 changed files with 10 additions and 10 deletions

View File

@@ -65,3 +65,12 @@ pub fn sync_autostart_on_startup(app: &AppHandle) -> Result<(), String> {
Ok(())
}
#[tauri::command]
pub fn toggle_autostart(app: AppHandle, enabled: bool) -> Result<(), String> {
toggle_autostart_logic(app, enabled)
}
#[tauri::command]
pub fn get_autostart_enabled(app: AppHandle) -> Result<bool, tauri_plugin_autostart::Error> {
get_autostart_enabled_logic(app)
}

View File

@@ -14,12 +14,3 @@ pub fn fetch_state(
drop(guard);
Ok(cloned_state)
}
#[tauri::command]
pub fn toggle_autostart(app: AppHandle, enabled: bool) -> Result<(), String> {
toggle_autostart_logic(app, enabled)
}
#[tauri::command]
pub fn get_autostart_enabled(app: AppHandle) -> Result<bool, tauri_plugin_autostart::Error> {
get_autostart_enabled_logic(app)
}

View File

@@ -11,8 +11,8 @@ mod error;
mod process;
mod remote;
use crate::commands::{get_autostart_enabled, toggle_autostart};
use crate::database::db::DatabaseImpls;
use autostart::{get_autostart_enabled, toggle_autostart};
use cleanup::{cleanup_and_exit, quit};
use commands::fetch_state;
use database::commands::{