Skip to content

Commit 9bfaca7

Browse files
HoonBaeksravan-s
authored andcommitted
fix: Modify the placeholder condition using initialized of channel list (#351)
1 parent c4333cf commit 9bfaca7

File tree

1 file changed

+6
-6
lines changed
  • src/smart-components/ChannelList/components/ChannelListUI

1 file changed

+6
-6
lines changed

src/smart-components/ChannelList/components/ChannelListUI/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const ChannelListUI: React.FC<ChannelListUIProps> = (props: ChannelListUIProps)
6161
channelListDispatcher,
6262
channelSource,
6363
typingChannels,
64+
initialized,
6465
} = useChannelListContext();
6566

6667
const state = useSendbirdStateContext();
@@ -75,7 +76,6 @@ const ChannelListUI: React.FC<ChannelListUIProps> = (props: ChannelListUIProps)
7576

7677
const sdk = sdkStore?.sdk as SendbirdGroupChat;
7778
const sdkError = sdkStore?.error;
78-
const sdkIntialized = sdkStore?.initialized || false;
7979

8080
const [channelsTomarkAsRead, setChannelsToMarkAsRead] = useState([]);
8181
useEffect(() => {
@@ -162,7 +162,7 @@ const ChannelListUI: React.FC<ChannelListUIProps> = (props: ChannelListUIProps)
162162
(sdkError) && (
163163
(renderPlaceHolderError && typeof renderPlaceHolderError === 'function') ? (
164164
renderPlaceHolderError?.()
165-
): (
165+
) : (
166166
<PlaceHolder type={PlaceHolderTypes.WRONG} />
167167
)
168168
)
@@ -236,19 +236,19 @@ const ChannelListUI: React.FC<ChannelListUIProps> = (props: ChannelListUIProps)
236236
}
237237
</div>
238238
{
239-
(!sdkIntialized || loading) && (
239+
(!initialized && loading) && (
240240
(renderPlaceHolderLoading && typeof renderPlaceHolderLoading === 'function') ? (
241241
renderPlaceHolderLoading?.()
242-
): (
242+
) : (
243243
<PlaceHolder type={PlaceHolderTypes.LOADING} />
244244
)
245245
)
246246
}
247247
{
248-
(!allChannels || allChannels.length === 0) && (
248+
(initialized && allChannels?.length === 0) && (
249249
(renderPlaceHolderEmptyList && typeof renderPlaceHolderEmptyList === 'function') ? (
250250
renderPlaceHolderEmptyList?.()
251-
): (
251+
) : (
252252
<PlaceHolder type={PlaceHolderTypes.NO_CHANNELS} />
253253
)
254254
)

0 commit comments

Comments
 (0)