SBChannelList 에서 신규 그룹채널을 생성할 때 기존에 있는 멤버와 동일한 채널인 경우 새로 생성되는 문제

React.js에서 UIKit을 사용하여 채널을 생성할 때
SBChannelList 에서 상당우측에 있는 신규 그룹채널을 생성 아이콘을 클릭하여 신규그룹채널을 생성할 때 기존에 있는 멤버와 동일한 채널인 경우 새로 생성되는 문제가 발생합니다.

isDistinct값을 true로 하여 설정하는 방법을 알고 자세히 싶습니다.
<SBChannelList
allowProfileEdit={true}
disableAutoSelect={false}
//onBeforeCreateChannel={{isDistinct:true}} 위와 같이 사용하면 onBeforeCreateChannel is not a function 에러가 발생합니다.
isTypingIndicatorEnabled={true}
onChannelSelect={(channel) => {
if (channel && channel.url) {
setCurrentChannelUrl(channel.url)
}
}}
/>

안녕하세요

아래와 같이 function으로 사용하는게 필요 합니다.

  const handleOnBeforeCreateChannel = (selectedUsers) => {
    const channelParams = {
      invitedUserIds: selectedUsers,
      isDistinct: true
    };
    return channelParams;
  };
...
  <ChannelList
    onBeforeCreateChannel={handleOnBeforeCreateChannel}
...

위 내용은 아래 링크에 기재되어 있으니 함께 참조 부탁 드립니다.

1 Like