support macos
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::{
|
||||
BrowserConfigEntry, BrowserConfigListResponse, BrowserConfigSource,
|
||||
CreateCustomBrowserConfigInput, CustomBrowserConfigRecord, StoredBrowserConfigs,
|
||||
},
|
||||
utils::local_app_data_dir,
|
||||
utils::platform_user_data_root_dir,
|
||||
};
|
||||
|
||||
const CONFIG_FILE_NAME: &str = "browser-configs.json";
|
||||
@@ -113,8 +113,8 @@ pub fn find_browser_config(app: &AppHandle, config_id: &str) -> Result<BrowserCo
|
||||
}
|
||||
|
||||
fn default_browser_configs() -> Result<Vec<BrowserConfigEntry>, String> {
|
||||
let local_app_data = local_app_data_dir().ok_or_else(|| {
|
||||
"Unable to resolve the LOCALAPPDATA directory for the current user.".to_string()
|
||||
let user_data_root = platform_user_data_root_dir().ok_or_else(|| {
|
||||
"Unable to resolve the default browser data directory for the current user.".to_string()
|
||||
})?;
|
||||
|
||||
Ok(browser_definitions()
|
||||
@@ -123,7 +123,7 @@ fn default_browser_configs() -> Result<Vec<BrowserConfigEntry>, String> {
|
||||
let user_data_path = definition
|
||||
.local_app_data_segments
|
||||
.iter()
|
||||
.fold(local_app_data.clone(), |path, segment| path.join(segment));
|
||||
.fold(user_data_root.clone(), |path, segment| path.join(segment));
|
||||
|
||||
BrowserConfigEntry {
|
||||
id: definition.id.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user