From 3e2a32922abc0b68f8fa6acbfb71195cffa3b54e Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 25 Aug 2022 10:56:43 +1000 Subject: [PATCH] fix: getUnread() messages should have the json as object rather than str --- ts/models/conversation.ts | 8 ++++---- ts/node/sql.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index bc14d2ccf..b080af0e4 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -479,10 +479,6 @@ export class ConversationModel extends Backbone.Model { ); } - public async getUnread() { - return Data.getUnreadByConversation(this.id); - } - public async getUnreadCount() { const unreadCount = await Data.getUnreadCountByConversation(this.id); @@ -1908,6 +1904,10 @@ export class ConversationModel extends Backbone.Model { : null; } + private async getUnread() { + return Data.getUnreadByConversation(this.id); + } + /** * * @returns The open group conversationId this conversation originated from diff --git a/ts/node/sql.ts b/ts/node/sql.ts index 9d4ad82ad..1d55f72b5 100644 --- a/ts/node/sql.ts +++ b/ts/node/sql.ts @@ -1094,7 +1094,7 @@ function getUnreadByConversation(conversationId: string) { conversationId, }); - return rows; + return map(rows, row => jsonToObject(row.json)); } function getUnreadCountByConversation(conversationId: string) {