Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
BrtqKr committed May 14, 2024
1 parent cd88a46 commit b04d1f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(

const undo = useCallback(
(target: HTMLDivElement) => {
if (!history.current) return '';
if (!history.current) {
return '';
}
const item = history.current.undo();
return parseText(target, item ? item.text : null, processedMarkdownStyle, item ? item.cursorPosition : null, false).text;
},
Expand All @@ -244,7 +246,9 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(

const redo = useCallback(
(target: HTMLDivElement) => {
if (!history.current) return '';
if (!history.current) {
return '';
}
const item = history.current.redo();
return parseText(target, item ? item.text : null, processedMarkdownStyle, item ? item.cursorPosition : null, false).text;
},
Expand Down

0 comments on commit b04d1f1

Please sign in to comment.