Skip to content

Commit ab06a8b

Browse files
committed
make file for custom storage
1 parent dae83de commit ab06a8b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src-tauri/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{injector, samp};
88

99
#[derive(Default)]
1010
pub struct AppState {
11-
storage_file: PathBuf,
11+
pub storage_file: PathBuf,
1212
}
1313

1414
#[tauri::command]

src-tauri/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ mod rpcs;
1010
mod samp;
1111

1212
use std::env;
13+
use std::path::PathBuf;
1314
use std::process::exit;
1415
use std::sync::Mutex;
1516

17+
use commands::AppState;
1618
use gumdrop::Options;
1719
use injector::run_samp;
1820
use log::{error, LevelFilter};
@@ -117,6 +119,12 @@ Options:
117119
});
118120

119121
match tauri::Builder::default()
122+
.manage(AppState {
123+
storage_file: PathBuf::from(format!(
124+
"{}/com.open.mp/storage.json",
125+
dirs_next::data_local_dir().unwrap().to_str().unwrap()
126+
)),
127+
})
120128
.plugin(tauri_plugin_upload::init())
121129
.setup(|app| {
122130
let handle = app.handle();

0 commit comments

Comments
 (0)