Skip to content

Commit

Permalink
[edit-widgets] Fix isSavingWidgetAreas selector (#24788)
Browse files Browse the repository at this point in the history
* Fix isSavingWidgetAreas selector

* Update copy
  • Loading branch information
adamziel authored Aug 26, 2020
1 parent 21da509 commit dad48f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/edit-widgets/src/components/save-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function SaveButton() {
onClick={ isSaving ? undefined : saveEditedWidgetAreas }
disabled={ ! hasEditedWidgetAreaIds }
>
{ __( 'Update' ) }
{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }
</Button>
);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/edit-widgets/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export const isSavingWidgetAreas = createRegistrySelector(
.getWidgetAreas()
?.map( ( { id } ) => id );
}
for ( const id in ids ) {
if ( ! ids ) {
return false;
}
for ( const id of ids ) {
const isSaving = select( 'core' ).isSavingEntityRecord(
KIND,
WIDGET_AREA_ENTITY_TYPE,
Expand Down

0 comments on commit dad48f5

Please sign in to comment.