friends list CRD
This commit is contained in:
+14
-3
@@ -1,17 +1,28 @@
|
||||
mod cursor;
|
||||
mod db;
|
||||
mod friends;
|
||||
mod ufa;
|
||||
mod windowing;
|
||||
|
||||
fn launch_app(app: &tauri::App) {
|
||||
async fn launch_app(app: &tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let handle = app.handle();
|
||||
crate::db::init(handle).await?;
|
||||
crate::ufa::init();
|
||||
crate::cursor::init(handle);
|
||||
crate::windowing::init(handle);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
let specta_builder = tauri_specta::Builder::<tauri::Wry>::new()
|
||||
.error_handling(tauri_specta::ErrorHandlingMode::Throw)
|
||||
.commands(tauri_specta::collect_commands![])
|
||||
.commands(tauri_specta::collect_commands![
|
||||
crate::friends::create_friend,
|
||||
crate::friends::list_friends,
|
||||
crate::friends::get_friend,
|
||||
crate::friends::delete_friend
|
||||
])
|
||||
.events(tauri_specta::collect_events![]);
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
@@ -26,7 +37,7 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.invoke_handler(specta_builder.invoke_handler())
|
||||
.setup(|app| {
|
||||
launch_app(app);
|
||||
tauri::async_runtime::block_on(launch_app(app))?;
|
||||
Ok(())
|
||||
})
|
||||
.build(tauri::generate_context!())
|
||||
|
||||
Reference in New Issue
Block a user