mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
Sort history from most recent edit to old
This commit is contained in:
parent
dfb039a936
commit
de9dd69891
@ -169,7 +169,9 @@ function MessageHistoryDialog({ bugId, commentId, open, onClose }: Props) {
|
|||||||
// NOTE Searching for the changed comment could be dropped if GraphQL get
|
// NOTE Searching for the changed comment could be dropped if GraphQL get
|
||||||
// filter by id argument for timelineitems
|
// filter by id argument for timelineitems
|
||||||
const comment = comments.find((elem) => elem.id === commentId);
|
const comment = comments.find((elem) => elem.id === commentId);
|
||||||
const history = comment?.history;
|
// Sort by most recent edit. Must create a copy of constant history as
|
||||||
|
// reverse() modifies inplace.
|
||||||
|
const history = comment?.history.slice().reverse();
|
||||||
|
|
||||||
const handleChange = (panel: string) => (
|
const handleChange = (panel: string) => (
|
||||||
event: React.ChangeEvent<{}>,
|
event: React.ChangeEvent<{}>,
|
||||||
@ -203,6 +205,7 @@ function MessageHistoryDialog({ bugId, commentId, open, onClose }: Props) {
|
|||||||
<Tooltip title={moment(edit.date).format('LLLL')}>
|
<Tooltip title={moment(edit.date).format('LLLL')}>
|
||||||
<Moment date={edit.date} format="on ll" />
|
<Moment date={edit.date} format="on ll" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
{index === 0 && '• (most recent edit)'}
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails>{edit.message}</AccordionDetails>
|
<AccordionDetails>{edit.message}</AccordionDetails>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
Loading…
Reference in New Issue
Block a user