Minor internal API change

This commit is contained in:
Rainer Simon 2020-05-01 15:58:25 +02:00
parent 574d805008
commit 53c842035b
1 changed files with 3 additions and 6 deletions

View File

@ -24,7 +24,7 @@ const Editor = props => {
// Re-render: set derived annotation state & position the editor
useEffect(() => {
// Shorthand: user wants a template applied and this is a selection
const shouldApplyTemplate = props.applyTemplate && props.annotation?.isSelection
const shouldApplyTemplate = props.applyTemplate && props.annotation?.isSelection;
// Apply template if needed
const annotation = shouldApplyTemplate ?
@ -34,8 +34,7 @@ const Editor = props => {
if (!currentAnnotation?.isEqual(annotation))
setCurrentAnnotation(annotation);
// In headless mode, create immediately
if (shouldApplyTemplate && props.headless)
if (shouldApplyTemplate && props.applyImmediately)
props.onAnnotationCreated(annotation.toAnnotation());
if (element.current)
@ -82,8 +81,6 @@ const Editor = props => {
}
};
console.log(props);
return (
<div ref={element} className="r6o-editor">
<div className="arrow" />