Skip to content

Commit

Permalink
Block Editor: Add notice action to revert image to original after cro…
Browse files Browse the repository at this point in the history
…pping
  • Loading branch information
Mamaduka committed Nov 26, 2024
1 parent 9407107 commit fbbc529
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ export default function useSaveImage( {
} );
createSuccessNotice( messages[ modifierType ], {
type: 'snackbar',
actions: [
{
label: __( 'Undo' ),
onClick: () => {
onSaveImage( {
id,
url,
} );
},
},
],
} );
} )
.catch( ( error ) => {
Expand Down

0 comments on commit fbbc529

Please sign in to comment.