From 40bc0b846437ad0a63f42a4fb9cee012188cd91f Mon Sep 17 00:00:00 2001 From: balzack Date: Sun, 12 Jan 2025 00:15:06 -0800 Subject: [PATCH] fix for message now showing up in channel list for sealed topics --- app/client/mobile/src/content/useContent.hook.ts | 4 ++-- app/client/web/src/content/useContent.hook.ts | 4 ++-- app/client/web/src/profile/useProfile.hook.ts | 2 +- app/sdk/src/contact.ts | 3 ++- app/sdk/src/stream.ts | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/client/mobile/src/content/useContent.hook.ts b/app/client/mobile/src/content/useContent.hook.ts index f64dd4dc..12b8a1a4 100644 --- a/app/client/mobile/src/content/useContent.hook.ts +++ b/app/client/mobile/src/content/useContent.hook.ts @@ -122,8 +122,8 @@ export function useContent() { } } else if (lastTopic.dataType === 'sealedtopic') { if (lastTopic.data) { - if (lastTopic.data.message?.text) { - return lastTopic.data.message.text; + if (lastTopic.data?.text) { + return lastTopic.data.text; } else { return ''; } diff --git a/app/client/web/src/content/useContent.hook.ts b/app/client/web/src/content/useContent.hook.ts index bac7acb5..6e9e5618 100644 --- a/app/client/web/src/content/useContent.hook.ts +++ b/app/client/web/src/content/useContent.hook.ts @@ -125,8 +125,8 @@ export function useContent() { } } else if (lastTopic.dataType === 'sealedtopic') { if (lastTopic.data) { - if (lastTopic.data.message?.text) { - return lastTopic.data.message.text + if (lastTopic.data?.text) { + return lastTopic.data.text } else { return '' } diff --git a/app/client/web/src/profile/useProfile.hook.ts b/app/client/web/src/profile/useProfile.hook.ts index ccd7732f..2f4eae9b 100644 --- a/app/client/web/src/profile/useProfile.hook.ts +++ b/app/client/web/src/profile/useProfile.hook.ts @@ -11,7 +11,7 @@ export function useProfile(params: ProfileParams) { const [state, setState] = useState({ strings: display.state.strings, cards: [] as Card[], - profile: {} as {} | Profile, + profile: {guid:''} as {guid:string} | Profile, guid: '', name: '', handle: '', diff --git a/app/sdk/src/contact.ts b/app/sdk/src/contact.ts index 5cfb0300..a1c7990d 100644 --- a/app/sdk/src/contact.ts +++ b/app/sdk/src/contact.ts @@ -1031,6 +1031,7 @@ export class ContactModule implements Contact { const channelData = detail.sealed ? item.unsealedDetail : detail.data || '{}'; const topicData = summary.sealed ? item.unsealedSummary : summary.data || '{}'; const parsed = this.parse(topicData); + const data = summary.sealed ? parsed?.message : parsed; return { channelId, @@ -1039,7 +1040,7 @@ export class ContactModule implements Contact { guid: summary.guid, sealed: summary.sealed, dataType: summary.dataType, - data: getLegacyData(parsed).data, + data: getLegacyData(data).data, created: summary.created, updated: summary.updated, status: summary.status, diff --git a/app/sdk/src/stream.ts b/app/sdk/src/stream.ts index 1aa6f345..ab14aebb 100644 --- a/app/sdk/src/stream.ts +++ b/app/sdk/src/stream.ts @@ -558,6 +558,7 @@ export class StreamModule { const channelData = detail.sealed ? item.unsealedDetail : detail.data || '{}'; const topicData = summary.sealed ? item.unsealedSummary : summary.data || '{}'; const parsed = this.parse(topicData); + const data = summary.sealed ? parsed?.message : parsed; return { channelId, @@ -566,7 +567,7 @@ export class StreamModule { guid: summary.guid, sealed: summary.sealed, dataType: summary.dataType, - data: getLegacyData(parsed).data, + data: getLegacyData(data).data, created: summary.created, updated: summary.updated, status: summary.status,