fix(ActivityCenter): Workaround for nil message (#10460)
* fix(ActivityCenter): Workaround for nil message Close #10455 * Update src/app/modules/main/activity_center/model.nim Co-authored-by: saledjenic <86303051+saledjenic@users.noreply.github.com> --------- Co-authored-by: saledjenic <86303051+saledjenic@users.noreply.github.com>
This commit is contained in:
parent
c548a96a2a
commit
591d466029
|
@ -71,7 +71,10 @@ QtObject:
|
|||
of NotifRoles.Name: result = newQVariant(activityNotificationItem.name)
|
||||
of NotifRoles.Author: result = newQVariant(activityNotificationItem.author)
|
||||
of NotifRoles.NotificationType: result = newQVariant(activityNotificationItem.notificationType.int)
|
||||
of NotifRoles.Message: result = newQVariant(activityNotificationItem.messageItem)
|
||||
of NotifRoles.Message: result = if not activityNotificationItem.messageItem.isNil:
|
||||
newQVariant(activityNotificationItem.messageItem)
|
||||
else:
|
||||
newQVariant()
|
||||
of NotifRoles.Timestamp: result = newQVariant(activityNotificationItem.timestamp)
|
||||
of NotifRoles.PreviousTimestamp: result = newQVariant(if index.row > 0:
|
||||
self.activityCenterNotifications[index.row - 1].timestamp
|
||||
|
|
|
@ -143,8 +143,8 @@ method convertToItems*(
|
|||
): seq[notification_item.Item] =
|
||||
result = activityCenterNotifications.map(
|
||||
proc(notification: ActivityCenterNotificationDto): notification_item.Item =
|
||||
var messageItem = msg_item_qobj.newMessageItem(nil)
|
||||
var repliedMessageItem = msg_item_qobj.newMessageItem(nil)
|
||||
var messageItem: MessageItem
|
||||
var repliedMessageItem: MessageItem
|
||||
# default section id is `Chat` section
|
||||
let sectionId = if notification.communityId.len > 0:
|
||||
notification.communityId
|
||||
|
|
Loading…
Reference in New Issue