feat: add first version of TougliGui with same features as on google sheet
This commit is contained in:
37
src-tauri/src/lib.rs
Normal file
37
src-tauri/src/lib.rs
Normal file
@ -0,0 +1,37 @@
|
||||
mod db;
|
||||
mod parser;
|
||||
mod commands;
|
||||
|
||||
use commands::DbState;
|
||||
use std::sync::Mutex;
|
||||
use tauri::Manager;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.setup(|app| {
|
||||
let conn = db::open().expect("Failed to open database");
|
||||
db::migrate(&conn).expect("Failed to migrate database");
|
||||
app.manage(DbState(Mutex::new(conn)));
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::get_profiles,
|
||||
commands::create_profile,
|
||||
commands::delete_profile,
|
||||
commands::get_completed_quests,
|
||||
commands::toggle_quest,
|
||||
commands::get_guides_list,
|
||||
commands::get_guide,
|
||||
commands::sync_guides,
|
||||
commands::get_tabs_list,
|
||||
commands::sync_single_guide,
|
||||
commands::has_guides,
|
||||
commands::get_setting,
|
||||
commands::set_setting,
|
||||
commands::set_always_on_top,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
Reference in New Issue
Block a user