From 6b15ace933c0bf89a1e10d9440f112904014ff64 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Tue, 14 Jun 2022 13:12:44 -0300 Subject: [PATCH] [FIX] In some discussions you haven't joined yet, messages are not being loaded. (#4269) * fix discussions not loadings * Adds one more layer of verification to get the correct room type --- app/views/RoomView/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 6a91f116e..d3c18517f 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -899,13 +899,15 @@ class RoomView extends React.Component { }; onDiscussionPress = debounce( - (item: TAnyMessageModel) => { + async (item: TAnyMessageModel) => { const { navigation } = this.props; + if (!item.drid) return; + const sub = await getRoomInfo(item.drid); navigation.push('RoomView', { rid: item.drid as string, - prid: item.rid, + prid: item?.subscription?.id, name: item.msg, - t: 'p' as SubscriptionType + t: (sub?.t as SubscriptionType) || (this.t as SubscriptionType) }); }, 1000,