From 037f5bf50b2bb2b020620413d186b6acf47a0b61 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 30 Sep 2018 11:00:39 +0200 Subject: timeline: various minor improvements --- bug/op_edit_comment.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bug/op_edit_comment.go') diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go index c6cfab2b..cb4a2216 100644 --- a/bug/op_edit_comment.go +++ b/bug/op_edit_comment.go @@ -57,18 +57,20 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { return } + comment := Comment{ + Message: op.Message, + Files: op.Files, + UnixTime: Timestamp(op.UnixTime), + } + switch target.(type) { case *CreateTimelineItem: item := target.(*CreateTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) case *CommentTimelineItem: item := target.(*CommentTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) } snapshot.Comments[commentIndex].Message = op.Message -- cgit