mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-30 09:15:02 +02:00
Fix ticket viewer bug (#1105)
* Fix ticket viewer bug * Fix ticket viewer bug
This commit is contained in:
parent
402af565a9
commit
e7daf76274
@ -86,16 +86,16 @@ class TicketViewer extends React.Component {
|
||||
const { editTitle, loading, edit, editId } = this.state;
|
||||
const { closed, author, content, date, edited, file, events} = ticket;
|
||||
const showResponseField = (!closed && (editable || !assignmentAllowed));
|
||||
const lastCommentIndex = events.map(
|
||||
const lastComment = events.map(
|
||||
(event, index) => {
|
||||
return {...event, index}}
|
||||
).filter(
|
||||
(event) => event.type === "COMMENT"
|
||||
).at(-1).index;
|
||||
).at(-1);
|
||||
|
||||
const eventsWithModifiedComments = events.map(
|
||||
(event, index) => {
|
||||
return {...event, isLastComment: index === lastCommentIndex && event.type === "COMMENT"};
|
||||
return {...event, isLastComment: lastComment && index === lastComment.index && event.type === "COMMENT"};
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user