mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-06 06:13:22 -04:00
correct setup
This commit is contained in:
@@ -69,11 +69,11 @@ pub async fn test_scan() -> Result<(), String> {
|
||||
// Ok(thumbnail_b64)
|
||||
// }
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub async fn get_thumbs_for_directory(window: tauri::Window, path: &str) -> Result<(), String> {
|
||||
let config = CONFIG.get().unwrap();
|
||||
// #[tauri::command(async)]
|
||||
// pub async fn get_thumbs_for_directory(window: tauri::Window, path: &str) -> Result<(), String> {
|
||||
// let config = CONFIG.get().unwrap();
|
||||
|
||||
let thumbnails = retrieve::get_thumbs_for_directory(path, &config).await?;
|
||||
// let thumbnails = retrieve::get_thumbs_for_directory(path, &config).await?;
|
||||
|
||||
// ....
|
||||
}
|
||||
// // ....
|
||||
// }
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
mod commands;
|
||||
mod menu;
|
||||
|
||||
use futures::executor::block_on;
|
||||
use sdcorelib;
|
||||
use tauri::api::path;
|
||||
|
||||
fn main() {
|
||||
let data_dir = path::data_dir().unwrap_or(std::path::PathBuf::from("./"));
|
||||
block_on(sdcorelib::configure(data_dir));
|
||||
|
||||
tauri::Builder::default()
|
||||
.setup(|_app| {
|
||||
let data_dir = path::data_dir().unwrap_or(std::path::PathBuf::from("./"));
|
||||
sdcorelib::configure(data_dir);
|
||||
Ok(())
|
||||
})
|
||||
.setup(|_app| Ok(()))
|
||||
.on_menu_event(|event| menu::handle_menu_event(event))
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::scan_dir,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pub mod checksum;
|
||||
pub mod icon;
|
||||
// pub mod icon;
|
||||
pub mod indexer;
|
||||
pub mod init;
|
||||
pub mod retrieve;
|
||||
|
||||
@@ -41,15 +41,15 @@ pub async fn configure(mut data_dir: std::path::PathBuf) {
|
||||
println!("Spacedrive daemon online");
|
||||
}
|
||||
|
||||
pub static MAIN_WINDOW: OnceCell<tauri::window> = OnceCell::new();
|
||||
// handler to pass "callback" to OneCell intercepting the commands
|
||||
pub fn emit(kind: &str, data: &str) {
|
||||
let _message = MAIN_WINDOW
|
||||
.get()
|
||||
.unwrap()
|
||||
.emit(kind, data)
|
||||
.map_err(|e| println!("{}", e));
|
||||
}
|
||||
// pub static MAIN_WINDOW: OnceCell<> = OnceCell::new();
|
||||
// // handler to pass "callback" to OneCell intercepting the commands
|
||||
// pub fn emit(kind: &str, data: &str) {
|
||||
// let _message = MAIN_WINDOW
|
||||
// .get()
|
||||
// .unwrap()
|
||||
// .emit(kind, data)
|
||||
// .map_err(|e| println!("{}", e));
|
||||
// }
|
||||
|
||||
fn main() {
|
||||
// hello!
|
||||
|
||||
Reference in New Issue
Block a user