diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-05-28 14:54:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 14:54:05 +0100 |
| commit | fc4dfe4fffce05c91f6766024891bdb39b2a3299 (patch) | |
| tree | a9a0923645a4e6f6047f25db0d2f4f25a984b4b0 /ui/backend/src/main.rs | |
| parent | chore(deps): bump uuid from 1.7.0 to 1.8.0 (#2047) (diff) | |
| download | atuin-fc4dfe4fffce05c91f6766024891bdb39b2a3299.zip | |
feat(ui): use correct username on welcome screen (#2050)
* wip
* fetch and use username
Diffstat (limited to 'ui/backend/src/main.rs')
| -rw-r--r-- | ui/backend/src/main.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/backend/src/main.rs b/ui/backend/src/main.rs index ce248d61..1616bff6 100644 --- a/ui/backend/src/main.rs +++ b/ui/backend/src/main.rs @@ -76,6 +76,11 @@ async fn config() -> Result<Settings, String> { } #[tauri::command] +async fn session() -> Result<String, String> { + Settings::new().map_err(|e|e.to_string())?.session_token().map_err(|e|e.to_string()) +} + +#[tauri::command] async fn home_info() -> Result<HomeInfo, String> { let settings = Settings::new().map_err(|e| e.to_string())?; let record_store_path = PathBuf::from(settings.record_store_path.as_str()); @@ -85,7 +90,7 @@ async fn home_info() -> Result<HomeInfo, String> { let client = atuin_client::api_client::Client::new( &settings.sync_address, - &settings.session_token, + settings.session_token().map_err(|e|e.to_string())?.as_str(), settings.network_connect_timeout, settings.network_timeout, ) @@ -132,6 +137,7 @@ fn main() { aliases, home_info, config, + session, dotfiles::aliases::import_aliases, dotfiles::aliases::delete_alias, dotfiles::aliases::set_alias, @@ -140,6 +146,7 @@ fn main() { dotfiles::vars::set_var, ]) .plugin(tauri_plugin_sql::Builder::default().build()) + .plugin(tauri_plugin_http::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } |
