Skip to content

Commit

Permalink
Refactor useMarkPersistent function
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Feb 27, 2024
1 parent 987fb58 commit db32d18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export function RichTextWrapper(
onChange,
} );

useMarkPersistent( { html: adjustedValue, value } );
useMarkPersistent( value );

const keyboardShortcuts = useRef( new Set() );
const inputEvents = useRef( new Set() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useDispatch } from '@wordpress/data';
*/
import { store as blockEditorStore } from '../../store';

export function useMarkPersistent( { html, value } ) {
export function useMarkPersistent( value ) {
const previousText = useRef();
const hasActiveFormats = !! value.activeFormats?.length;
const { __unstableMarkLastChangeAsPersistent } =
Expand All @@ -36,5 +36,5 @@ export function useMarkPersistent( { html, value } ) {
}

__unstableMarkLastChangeAsPersistent();
}, [ html, hasActiveFormats ] );
}, [ value.text, hasActiveFormats ] );
}

0 comments on commit db32d18

Please sign in to comment.