Skip to content

Commit

Permalink
Fix the save button label for BTP (WordPress#51361)
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr authored and sethrubenstein committed Jul 13, 2023
1 parent 7ef654c commit 7f46895
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions packages/edit-site/src/components/save-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,24 @@ export default function SaveButton( {
const disabled = isSaving || ! activateSaveEnabled;

const getLabel = () => {
if ( isPreviewingTheme() ) {
if ( isSaving ) {
return __( 'Activating' );
} else if ( disabled ) {
return __( 'Saved' );
} else if ( isDirty ) {
return __( 'Activate & Save' );
}
return __( 'Activate' );
}

if ( isSaving ) {
return __( 'Saving' );
}
if ( disabled ) {
} else if ( disabled ) {
return __( 'Saved' );
} else if ( defaultLabel ) {
return defaultLabel;
}

if ( defaultLabel ) return defaultLabel;

if ( isPreviewingTheme() && isDirty ) {
return __( 'Activate & Save' );
} else if ( isPreviewingTheme() ) {
return __( 'Activate' );
}

return __( 'Save' );
};
const label = getLabel();
Expand Down

0 comments on commit 7f46895

Please sign in to comment.