UI to show modules
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
use crate::{
|
||||
lock_r,
|
||||
models::app_data::AppData,
|
||||
state::{init_app_data_scoped, AppDataRefreshScope, FDOLL},
|
||||
};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_app_data() -> Result<AppData, String> {
|
||||
let guard = lock_r!(FDOLL);
|
||||
Ok(guard.user_data.clone())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn refresh_app_data() -> Result<AppData, String> {
|
||||
init_app_data_scoped(AppDataRefreshScope::All).await;
|
||||
let guard = lock_r!(FDOLL);
|
||||
Ok(guard.user_data.clone())
|
||||
}
|
||||
25
src-tauri/src/commands/app_state.rs
Normal file
25
src-tauri/src/commands/app_state.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use crate::{
|
||||
lock_r,
|
||||
models::app_data::UserData,
|
||||
services::presence_modules::models::ModuleMetadata,
|
||||
state::{init_app_data_scoped, AppDataRefreshScope, FDOLL},
|
||||
};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_app_data() -> Result<UserData, String> {
|
||||
let guard = lock_r!(FDOLL);
|
||||
Ok(guard.user_data.clone())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn refresh_app_data() -> Result<UserData, String> {
|
||||
init_app_data_scoped(AppDataRefreshScope::All).await;
|
||||
let guard = lock_r!(FDOLL);
|
||||
Ok(guard.user_data.clone())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_modules() -> Result<Vec<ModuleMetadata>, String> {
|
||||
let guard = lock_r!(FDOLL);
|
||||
Ok(guard.modules.metadatas.clone())
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
pub mod app;
|
||||
pub mod app_data;
|
||||
pub mod app_state;
|
||||
pub mod auth;
|
||||
pub mod config;
|
||||
pub mod dolls;
|
||||
|
||||
Reference in New Issue
Block a user