File tree Expand file tree Collapse file tree
apps/chat/src/app/pages/channel
libs/store/src/lib/channels Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments