mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
fix(messaging): only show date if date changes
This commit is contained in:
@@ -104,6 +104,7 @@ export default observer(({ last_id, renderer, highlight }: Props) => {
|
||||
prevAuthor: string,
|
||||
previousMasq: Nullable<Masquerade>,
|
||||
) {
|
||||
head = false;
|
||||
const atime = decodeTime(current),
|
||||
adate = new Date(atime),
|
||||
btime = decodeTime(previous),
|
||||
@@ -115,14 +116,17 @@ export default observer(({ last_id, renderer, highlight }: Props) => {
|
||||
divided = true;
|
||||
}
|
||||
|
||||
head = false;
|
||||
let date;
|
||||
if (
|
||||
unread ||
|
||||
adate.getFullYear() !== bdate.getFullYear() ||
|
||||
adate.getMonth() !== bdate.getMonth() ||
|
||||
adate.getDate() !== bdate.getDate()
|
||||
) {
|
||||
render.push(<DateDivider date={adate} unread={unread} />);
|
||||
date = adate;
|
||||
}
|
||||
|
||||
if (unread || date) {
|
||||
render.push(<DateDivider date={date} unread={unread} />);
|
||||
head = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user