Skip to content

Commit

Permalink
Post Editor: adds autosave parameter to outbound queries
Browse files Browse the repository at this point in the history
When the post editor decides to save automatically, add an autosave parameter to
the API query.

This allows the server to differentiate between autosaves, and manual saves.
  • Loading branch information
roccotripaldi committed Nov 15, 2017
1 parent 42cf868 commit a3a0b8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/lib/posts/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ PostActions = {
}
);
} else {
PostActions.saveEdited( null, null, callback, { recordSaveEvent: false } );
PostActions.saveEdited( null, null, callback, { recordSaveEvent: false, autosave: true } );
}
},

Expand Down Expand Up @@ -347,6 +347,9 @@ PostActions = {
context: 'edit',
apiVersion: '1.2',
};
if ( options && options.autosave ) {
query.autosave = options.autosave;
}

if ( ! options || options.recordSaveEvent !== false ) {
recordSaveEvent( context ); // do this before changing status from 'future'
Expand Down

0 comments on commit a3a0b8d

Please sign in to comment.