Fix daybreak not showing before RoomCreateEvent

This commit is contained in:
miruka 2019-08-30 10:33:17 -04:00
parent 10a53d7afb
commit f0612c2a51
2 changed files with 8 additions and 10 deletions

View File

@ -11,7 +11,6 @@
- When qml syntax highlighting supports ES6 string interpolation, use them - When qml syntax highlighting supports ES6 string interpolation, use them
- Fixes - Fixes
- Daybreak?
- Collapsing last account with shortcut when focused on room - Collapsing last account with shortcut when focused on room
- Using up/down when sidepane focused - Using up/down when sidepane focused
- Missing hourglass when changing avatar and applying - Missing hourglass when changing avatar and applying

View File

@ -13,7 +13,7 @@ Rectangle {
Component.onCompleted: shortcuts.flickTarget = eventList Component.onCompleted: shortcuts.flickTarget = eventList
function canCombine(item, itemAfter) { function canCombine(item, itemAfter) {
if (! item || ! itemAfter) { return false } if (! item || ! itemAfter) return false
return Boolean( return Boolean(
! canTalkBreak(item, itemAfter) && ! canTalkBreak(item, itemAfter) &&
@ -24,7 +24,7 @@ Rectangle {
} }
function canTalkBreak(item, itemAfter) { function canTalkBreak(item, itemAfter) {
if (! item || ! itemAfter) { return false } if (! item || ! itemAfter) return false
return Boolean( return Boolean(
! canDayBreak(item, itemAfter) && ! canDayBreak(item, itemAfter) &&
@ -33,14 +33,13 @@ Rectangle {
} }
function canDayBreak(item, itemAfter) { function canDayBreak(item, itemAfter) {
if (! item || ! itemAfter || ! item.date || ! itemAfter.date) { if (itemAfter && itemAfter.event_type == "RoomCreateEvent")
return false return true
}
return Boolean( if (! item || ! itemAfter || ! item.date || ! itemAfter.date)
itemAfter.event_type == "RoomCreateEvent" || return false
item.date.getDate() != itemAfter.date.getDate()
) return item.date.getDate() != itemAfter.date.getDate()
} }
model: HListModel { model: HListModel {