Desktop: Use the OS temp directory for CEF caches (#4030)

* Desktop: Use the OS temp dir

* Review
This commit is contained in:
Timon
2026-04-15 10:47:45 +00:00
committed by GitHub
parent 60f16d72a5
commit 2a2a60883d
8 changed files with 95 additions and 54 deletions
+10
View File
@@ -98,6 +98,8 @@ impl PersistentData {
}
pub(crate) fn load_from_disk(&mut self) {
delete_old_cef_browser_directory();
let path = Self::state_file_path();
let data = match std::fs::read_to_string(&path) {
Ok(d) => d,
@@ -157,3 +159,11 @@ impl PersistentData {
path
}
}
// TODO: Eventually remove this cleanup code for the old "browser" CEF directory
fn delete_old_cef_browser_directory() {
let old_browser_dir = crate::dirs::app_data_dir().join("browser");
if old_browser_dir.is_dir() {
let _ = std::fs::remove_dir_all(&old_browser_dir);
}
}