This commit is contained in:
Rainer Simon 2020-05-18 08:58:35 +02:00
parent a5ee24718a
commit 7b6ab418a6
2 changed files with 5 additions and 4 deletions

View File

@ -11,6 +11,7 @@ const Comment = props => {
const [ isMenuVisible, setIsMenuVisible ] = useState(false); const [ isMenuVisible, setIsMenuVisible ] = useState(false);
const onMakeEditable = _ => { const onMakeEditable = _ => {
props.body.draft = true;
setIsEditable(true); setIsEditable(true);
setIsMenuVisible(false); setIsMenuVisible(false);
} }

View File

@ -30,11 +30,11 @@ const CommentWidget = props => {
const all = props.annotation ? const all = props.annotation ?
props.annotation.bodies.filter(isComment) : []; props.annotation.bodies.filter(isComment) : [];
// Non-draft comments // Last draft comment without a creator field goes into the reply field
const comments = all.filter(b => !b.draft); const draftReply = getDraftReply(all.reverse().find(b => b.draft && !b.creator), all.length > 1);
// Draft reply // All except draft reply
const draftReply = getDraftReply(all.find(b => b.draft), comments.length > 0); const comments = all.filter(b => b != draftReply);
const onEditReply = evt => { const onEditReply = evt => {
const prev = draftReply.value.trim(); const prev = draftReply.value.trim();