Desktop: Move autosave persistence to native (#3134)

* Move autosave persistence to native 1

* Move autosave persistence to native 2

* Reimplement quirky behavior of the web frontend

* Code revew

* Use select_after_open

* fix fmt

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Timon
2025-09-09 11:27:54 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 1808bea2cf
commit 4261b7dad1
11 changed files with 387 additions and 21 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
use std::fs::create_dir_all;
use std::path::PathBuf;
use crate::consts::APP_DIRECTORY_NAME;
use crate::consts::{APP_AUTOSAVE_DIRECTORY_NAME, APP_DIRECTORY_NAME};
pub(crate) fn ensure_dir_exists(path: &PathBuf) {
if !path.exists() {
@@ -14,3 +14,9 @@ pub(crate) fn graphite_data_dir() -> PathBuf {
ensure_dir_exists(&path);
path
}
pub(crate) fn graphite_autosave_documents_dir() -> PathBuf {
let path = graphite_data_dir().join(APP_AUTOSAVE_DIRECTORY_NAME);
ensure_dir_exists(&path);
path
}