Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
fix: optic-354: coment draft preserved between annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis1282 committed Dec 28, 2023
1 parent 88ba15c commit 1300f73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Comments/CommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FF_DEV_3873, isFF } from '../../utils/feature-flags';

export type CommentFormProps = {
commentStore: any,
value?: string,
annotationStore: any,
onChange?: (value: string) => void,
inline?: boolean,
rows?: number,
Expand All @@ -19,7 +19,7 @@ export type CommentFormProps = {

export const CommentForm: FC<CommentFormProps> = observer(({
commentStore,
value = '',
annotationStore,
inline = true,
onChange,
rows = 1,
Expand Down Expand Up @@ -52,7 +52,6 @@ export const CommentForm: FC<CommentFormProps> = observer(({
commentStore.setCurrentComment(comment || '');
}, [commentStore]);


useEffect(() => {
if (!isFF(FF_DEV_3873)) {
commentStore.setAddedCommentThisSession(false);
Expand All @@ -72,6 +71,7 @@ export const CommentForm: FC<CommentFormProps> = observer(({
commentStore.setCommentFormSubmit(() => onSubmit());
}, [actionRef, commentStore]);

const value = commentStore.currentComment[annotationStore.selected.id] || '';

return (
<Block ref={formRef} tag="form" name="comment-form" mod={{ inline }} onSubmit={onSubmit}>
Expand Down

0 comments on commit 1300f73

Please sign in to comment.