Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid unexpectedly marking post content as unsaved #23969

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
25.7
-----
* [**] Enable history navigation (undo and redo) for the experimental editor. [#23961]
* [*] Avoid unexpectedly marking post content as unsaved. [#23969]

25.6
dcalhoun marked this conversation as resolved.
Show resolved Hide resolved
-----
* [**] Add Image Playground support (part of Apple Intelligence suite) for adding images to your posts, generated featured image, site icons, and more [#23688]
* [**] Enable history navigation (undo and redo) for the experimental editor. [#23961]
* [**] Various bug fixes and improvements in the new experimental editor [#23919]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor
private let editorViewController: GutenbergKit.EditorViewController
private weak var autosaveTimer: Timer?

var editorHasChanges: Bool {
var changes = post.changes
// TODO: cleanup (+ it doesn't handle scenarios like load from a revision)
// - warning: it has to compare two version serialized using the same system
if editorViewController.initialContent != post.content {
changes.content = post.content
} else {
changes.content = nil // yes, it needs to be set to .none manually
}
return !changes.isEmpty
}

// TODO: remove (none of these APIs are needed for the new editor)
var autosaver = Autosaver(action: {})
func prepopulateMediaItems(_ media: [Media]) {}
Expand Down