diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index 076a9f7370..2ad610f72c 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -397,6 +397,7 @@ "This_room_is_blocked": "This room is blocked", "This_room_is_read_only": "This room is read only", "Threads": "Threads", + "Thread": "Thread", "Timezone": "Timezone", "topic": "topic", "Topic": "Topic", diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 42b4f7cf60..9d1f98a96f 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -94,6 +94,7 @@ import { withActionSheet, IActionSheetProvider } from '../../containers/ActionSh import { goRoom, TGoRoomItem } from '../../lib/methods/helpers/goRoom'; import audioPlayer from '../../lib/methods/audioPlayer'; import { IListContainerRef, TListRef } from './List/definitions'; +import { getThreadById } from '../../lib/database/services/Thread'; type TStateAttrsUpdate = keyof IRoomViewState; @@ -1128,6 +1129,15 @@ class RoomView extends React.Component { return getThreadName(rid, tmid, messageId); }; + fetchThreadName = async (tmid: string, messageId: string) => { + const { rid } = this.state.room; + const threadRecord = await getThreadById(tmid); + if (threadRecord?.t === 'rm') { + return I18n.t('Message_removed'); + } + return getThreadName(rid, tmid, messageId); + }; + toggleFollowThread = async (isFollowingThread: boolean, tmid?: string) => { try { const threadMessageId = tmid ?? this.tmid; @@ -1177,6 +1187,10 @@ class RoomView extends React.Component { jumpToMessageId = item.id; } sendLoadingEvent({ visible: true, onCancel: this.cancelJumpToMessage }); + const threadRecord = await getThreadById(item.tmid); + if (threadRecord?.t === 'rm') { + name = I18n.t('Thread'); + } if (!name) { const result = await this.getThreadName(item.tmid, jumpToMessageId); // test if there isn't a thread @@ -1335,7 +1349,7 @@ class RoomView extends React.Component { isThreadRoom={!!this.tmid} isIgnored={this.isIgnored(item)} previousItem={previousItem} - fetchThreadName={this.getThreadName} + fetchThreadName={this.fetchThreadName} onReactionPress={this.onReactionPress} onReactionLongPress={this.onReactionLongPress} onLongPress={this.onMessageLongPress}