|
|
@ -3,7 +3,7 @@ use crate::client_api::ApiClient;
|
|
|
|
use crate::tauri_plugin::commands::{ApiAccess, AppAccess, BufferAccess};
|
|
|
|
use crate::tauri_plugin::commands::{ApiAccess, AppAccess, BufferAccess};
|
|
|
|
use crate::tauri_plugin::error::{PluginError, PluginResult};
|
|
|
|
use crate::tauri_plugin::error::{PluginError, PluginResult};
|
|
|
|
use crate::tauri_plugin::settings::{save_settings, Repository};
|
|
|
|
use crate::tauri_plugin::settings::{save_settings, Repository};
|
|
|
|
use crate::types::repo::FrontendState;
|
|
|
|
use crate::types::repo::{FrontendState, RepositoryMetadata};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use std::mem;
|
|
|
|
use std::mem;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
use std::path::PathBuf;
|
|
|
@ -190,6 +190,14 @@ pub async fn select_repository(
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
|
|
|
pub async fn get_repo_metadata(api_state: ApiAccess<'_>) -> PluginResult<RepositoryMetadata> {
|
|
|
|
|
|
|
|
let api = api_state.api().await?;
|
|
|
|
|
|
|
|
let metadata = api.repo.get_repo_metadata().await?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ok(metadata)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
#[tauri::command]
|
|
|
|
pub async fn get_frontend_state(api_state: ApiAccess<'_>) -> PluginResult<Option<String>> {
|
|
|
|
pub async fn get_frontend_state(api_state: ApiAccess<'_>) -> PluginResult<Option<String>> {
|
|
|
|
let api = api_state.api().await?;
|
|
|
|
let api = api_state.api().await?;
|
|
|
|