mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 22:48:13 +08:00
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:
+7
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user