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 onMakeEditable = _ => {
props.body.draft = true;
setIsEditable(true);
setIsMenuVisible(false);
}

View File

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