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

Editor: minor trash pickup to make autoSave dialog logic more legible #9886

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

timmyc
Copy link
Contributor

@timmyc timmyc commented Dec 8, 2016

While investigating #9833 - the code trail led me to post-editor.jsx. Much TODO in this file, but the particular area I was looking at had a long if statement that was begging to be simplified with a get - so in an effort to pickup trash daily, here is a very small PR.

Changes Made
Updated the conditional logic that determines if autosave data exists to use lodash#get(). And for good measure removed old debug statements.

To Test
Ideally - get a published post to have some autosave data. To do so, open a published post in the editor, make some changes and wait for the autosave to kick in.

  • Open the post with autosave data in the editor, confirm the autosave restore dialog is still shown
  • Open a new draft in the editor, ensure no dialog is shown

@timmyc timmyc added [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Janitorial labels Dec 8, 2016
@timmyc timmyc requested a review from youknowriad December 8, 2016 01:04
@matticbot
Copy link
Contributor

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@timmyc timmyc force-pushed the update/editor/trash-pickup branch from a457a86 to e1ec698 Compare December 9, 2016 00:37
@timmyc timmyc merged commit d25b90f into master Dec 9, 2016
@timmyc timmyc deleted the update/editor/trash-pickup branch December 9, 2016 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants