feat(desktop): isolate private data by account

This commit is contained in:
冰朔 2026-08-16 18:25:57 +08:00
commit 1d2a8a2f63
12 changed files with 143 additions and 60 deletions

View file

@ -8,7 +8,7 @@ use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
use std::path::{Component, Path, PathBuf};
use std::process::Command;
use std::time::{SystemTime, UNIX_EPOCH};
use tauri::{AppHandle, Manager};
use tauri::AppHandle;
use tauri_plugin_dialog::DialogExt;
use url::Url;
use uuid::Uuid;
@ -175,11 +175,7 @@ pub async fn read_code_channel_file(
}
fn code_channel_root(app: &AppHandle) -> Result<PathBuf, String> {
let root = app
.path()
.app_data_dir()
.map_err(|error| format!("HOLOLAKE_APP_DATA_UNAVAILABLE: {error}"))?
.join("code-channel-v1");
let root = crate::authenticated_storage::account_storage_root(app, "code-channel-v1")?;
ensure_root(&root)?;
Ok(root)
}