fix: ensure new documents / drafts are also autosaved - #1802
Open
gi1242 wants to merge 1 commit into
Open
Conversation
flxzt
reviewed
Jul 16, 2026
| // --- AUTOSAVE RECOVERY CHECK --- | ||
| let input_file_clone = input_file.clone(); | ||
| glib::spawn_future_local(clone!(#[weak] appwindow, async move { | ||
| let cache_dir = glib::user_cache_dir(); |
Owner
There was a problem hiding this comment.
Can you add a function wrapping this invocation to env.rs? I want to have all functionality with regards to specific system and user directories collected there.
|
|
||
| pub(crate) static OUTPUT_FILE_NEW_TITLE: once_cell::sync::Lazy<String> = | ||
| once_cell::sync::Lazy::new(|| gettext("New Document")); | ||
| once_cell::sync::Lazy::new(|| String::from("%Y%m%d-%H%M%S")); |
Collaborator
There was a problem hiding this comment.
Does this fixes a single date for each rnote session ? I'm not convinced this is run once by canvas/new file (in which case it's better to remove the static and move the date logic where it's needed : here and in default_file_title_for_export)
Collaborator
|
Fixes #1592 as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When opening a new file, rnote won't autosave it until it's saved first. The default name is "New Document", and on tablets it's often a burden to choose a name and save it. So I often just work without saving the file initially. If there's a crash, then everything is lost.
I just implemented a fix:
Fixes #545