Bugfixes
This commit is contained in:
parent
a5ee24718a
commit
7b6ab418a6
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue