Skip to content

Commit 39da648

Browse files
Merge pull request #13257 from sadohpv/fix26b/web/fix-ctrl-K-thread
260608 - WEB/DESKTOP - fix archive thread hard code
2 parents 1ee5244 + ac5a171 commit 39da648

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

apps/chat/src/app/pages/channel/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
ONE_MILISECONDS,
5454
ONE_MINUTE_MS,
5555
SubPanelName,
56+
ThreadStatus,
5657
buildChannelAppLaunchUrl,
5758
generateE2eId,
5859
isBackgroundModeActive,
@@ -111,8 +112,8 @@ function useChannelSeen(channelId: string) {
111112

112113
const updateChannelSeenState = useCallback(
113114
(_channelId: string) => {
114-
if (currentChannel.type === ChannelType.CHANNEL_TYPE_THREAD) {
115-
const channelWithActive = { ...currentChannel, active: 1 };
115+
if (currentChannel.type === ChannelType.CHANNEL_TYPE_THREAD && currentChannel.active === ThreadStatus.archived) {
116+
const channelWithActive = { ...currentChannel, active: ThreadStatus.activePublic };
116117
dispatch(
117118
channelsActions.upsertOne({
118119
clanId: currentChannel?.clan_id || '0',

libs/store/src/lib/channels/channels.slice.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ export const addThreadToChannels = createAsyncThunk(
718718
clanId,
719719
channel: {
720720
...matchedThread,
721-
active: matchedThread.active ? ThreadStatus.joined : ThreadStatus.activePublic
721+
active: matchedThread.active
722722
} as ChannelsEntity
723723
})
724724
);
@@ -809,7 +809,10 @@ export const fetchChannels = createAsyncThunk(
809809
)
810810
.unwrap();
811811
if (data?.threads?.length > 0) {
812-
response.channeldesc.push({ ...data.threads[0], active: 1 } as ChannelsEntity);
812+
response.channeldesc.push({
813+
...data.threads[0],
814+
active: data.threads[0].active ? data.threads[0].active : ThreadStatus.activePublic
815+
} as ChannelsEntity);
813816
}
814817
}
815818
} catch (error) {

0 commit comments

Comments
 (0)