Skip to content

Commit

Permalink
Ensure that the autosave happens on empty posts in the native apps. (#…
Browse files Browse the repository at this point in the history
…23233)

On the native apps, the publish button is managed by native code on
the apps (non Gutenberg/JS code). In order to update the status of the
publish button correctly we need to autosave even when there is no
content, in order to send that information across the native code.
  • Loading branch information
SergioEstevao committed Jul 17, 2020
1 parent 0aa8dcc commit 3d0a992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { isInTheFuture, getDate } from '@wordpress/date';
import { addQueryArgs } from '@wordpress/url';
import { createRegistrySelector } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
import { Platform } from '@wordpress/element';

/**
* Internal dependencies
Expand Down Expand Up @@ -545,7 +546,8 @@ export function isEditedPostSaveable( state ) {
return (
!! getEditedPostAttribute( state, 'title' ) ||
!! getEditedPostAttribute( state, 'excerpt' ) ||
! isEditedPostEmpty( state )
! isEditedPostEmpty( state ) ||
Platform.OS === 'native'
);
}

Expand Down

0 comments on commit 3d0a992

Please sign in to comment.