Files
AstralRinth/theseus_gui/src-tauri/src/main.rs
T
Wyatt Verchere 6a05276a21 Auth bindings (#58)
* basic framework. still has errors

* added functionality for main endpoints + some structuring

* formatting

* unused code

* mimicked CLI function with wait_for process

* added basic auth bindings

* made PR changes, added playground

* cargo fmt

* removed missed println

* misc tests fixes

* cargo fmt

* added windows support

* cargo fmt

* all OS use dunce

* restructured profile slightly; fixed mac bug

* profile changes, new main.rs

* fixed requested pr + canonicaliation bug

* fixed regressed bug in ui

* fixed regressed bugs

* fixed git error

* typo

* ran prettier

* clippy

* playground clippy

* ported profile loading fix

* profile change for real, url println and clippy

* PR changes

* auth bindings + semisynch flow

* fixed dropping task error

* prettier, eslint, clippy

* removed debugging modifications

* removed unused function that eslinter missed :(

* fixed settings not being released

---------

Co-authored-by: Wyatt <wyatt@modrinth.com>
2023-03-31 18:44:26 -07:00

45 lines
1.4 KiB
Rust

#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use theseus::prelude::*;
mod api;
// Should be called in launcher initialization
#[tauri::command]
async fn initialize_state() -> api::Result<()> {
State::get().await?;
Ok(())
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
initialize_state,
api::profile_create::profile_create_empty,
api::profile_create::profile_create,
api::profile::profile_add,
api::profile::profile_add_path,
api::profile::profile_remove,
api::profile::profile_get,
api::profile::profile_is_managed,
api::profile::profile_is_loaded,
api::profile::profile_list,
api::profile::profile_run,
api::profile::profile_run_wait,
api::profile::profile_kill,
api::profile::profile_wait_for,
api::auth::auth_authenticate_begin_flow,
api::auth::auth_authenticate_await_completion,
api::auth::auth_refresh,
api::auth::auth_remove_user,
api::auth::auth_has_user,
api::auth::auth_users,
api::auth::auth_get_user,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}