Skip to content

Commit 7c0cda6

Browse files
committed
Updated UIKit version to 6.0.5
1 parent d295ba6 commit 7c0cda6

File tree

28 files changed

+255
-139
lines changed

28 files changed

+255
-139
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@cometchat/chat-uikit-react",
3-
"version": "6.0.4",
3+
"version": "6.0.5",
44
"description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
55
"author": "CometChat",
66
"exports": {
77
".": "./dist/index.js",
88
"./css-variables.css": "./dist/styles/css-variables.css"
99
},
1010
"dependencies": {
11-
"@cometchat/chat-sdk-javascript": "^4.0.11",
11+
"@cometchat/chat-sdk-javascript": "^4.0.12",
1212
"@rollup/plugin-json": "^6.1.0",
1313
"rxjs": "^7.8.1"
1414
},

sample-app/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [6.0.4] - 25-04-2025
2+
3+
## New
4+
- None
5+
6+
## Enhancements
7+
- None
8+
9+
## Fixes
10+
- Resolved a problem where the input field remained active when the backdrop was open for password entry in password-protected groups.
11+
- Fixed an issue where the group owner scope was not updating when a user left a password-protected group.
12+
113
## [6.0.3] - 11-04-2025
214

315
## New

sample-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "sample-app",
3-
"version": "6.0.3",
3+
"version": "6.0.4",
44
"description": "React App made using CometChat React v6 UI Kit.",
55
"author": "CometChat",
66
"private": true,
77
"dependencies": {
88
"@cometchat/calls-sdk-javascript": "^4.0.11",
9-
"@cometchat/chat-sdk-javascript": "^4.0.11",
10-
"@cometchat/chat-uikit-react": "~6.0.4",
9+
"@cometchat/chat-sdk-javascript": "^4.0.12",
10+
"@cometchat/chat-uikit-react": "~6.0.5",
1111
"react": "18.2.0",
1212
"react-dom": "18.2.0",
1313
"react-router-dom": "6.14.2",

sample-app/src/components/CometChatHome/CometChatHome.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { CometChatUserDetails } from "../CometChatDetails/CometChatUserDetails";
2525
import { CometChatThreadedMessages } from "../CometChatDetails/CometChatThreadedMessages";
2626
import { CometChatCallDetails } from "../CometChatCallLog/CometChatCallLogDetails";
2727
import { CometChatAlertPopup } from "../CometChatAlertPopup/CometChatAlertPopup";
28-
import { CometChatAvatar,CometChatButton,CometChatConfirmDialog,CometChatConversationEvents,CometChatGroupEvents,CometChatGroupMembers,CometChatGroups,CometChatIncomingCall,CometChatMessageEvents,CometChatToast,CometChatUIKit,CometChatUIKitConstants,CometChatUIKitLoginListener,CometChatUIKitUtility,CometChatUserEvents,CometChatUsers,CometChatUIEvents,getLocalizedString,IMessages,IMouseEvent,IActiveChatChanged,MessageStatus,IGroupMemberAdded,IGroupMemberKickedBanned } from "@cometchat/chat-uikit-react";
28+
import { CometChatAvatar,CometChatButton,CometChatConfirmDialog,CometChatConversationEvents,CometChatGroupEvents,CometChatGroupMembers,CometChatGroups,CometChatIncomingCall,CometChatMessageEvents,CometChatToast,CometChatUIKit,CometChatUIKitConstants,CometChatUIKitLoginListener,CometChatUIKitUtility,CometChatUserEvents,CometChatUsers,CometChatUIEvents,getLocalizedString,IMessages,IMouseEvent,IActiveChatChanged,MessageStatus,IGroupMemberAdded,IGroupMemberKickedBanned, IGroupMemberJoined } from "@cometchat/chat-uikit-react";
2929
import { CallLog } from "@cometchat/calls-sdk-javascript";
3030

3131
interface TabContentProps {
@@ -285,9 +285,9 @@ function CometChatHome(props: { theme?: string }) {
285285
}, [activeTab, selectedItem]);
286286

287287
const updateisFirstChat = ({ message, status }: IMessages) => {
288-
const receiverId = message.getReceiverId();
289-
const sender = message.getSender();
290-
if ((appState.selectedItemUser && (appState.selectedItemUser.getUid() == receiverId || (appState.selectedItemUser.getUid() == sender.getUid() && receiverId == loggedInUser?.getUid())) || appState.selectedItemGroup && (appState.selectedItemGroup.getGuid() == receiverId || loggedInUser?.getUid() == receiverId)) && isFreshChatRef.current && status == MessageStatus.success) {
288+
const receiverId = message?.getReceiverId();
289+
const sender = message?.getSender();
290+
if ((appState.selectedItemUser && (appState.selectedItemUser.getUid() == receiverId || ((!sender || (sender && appState.selectedItemUser.getUid() == sender.getUid())) && receiverId == loggedInUser?.getUid())) || appState.selectedItemGroup && (appState.selectedItemGroup.getGuid() == receiverId || loggedInUser?.getUid() == receiverId)) && isFreshChatRef.current && status == MessageStatus.success) {
291291
setAppState({ type: 'updateIsFreshChat', payload: false });
292292
isFreshChatRef.current = false;
293293
let conversationWith = appState.selectedItemUser ? appState.selectedItemUser.getUid() : appState.selectedItemGroup?.getGuid();
@@ -1082,6 +1082,7 @@ function CometChatHome(props: { theme?: string }) {
10821082
if (loggedInUser) {
10831083
const groupClone = CometChatUIKitUtility.clone(group);
10841084
groupClone.setHasJoined(false);
1085+
groupClone.setMembersCount(groupClone.getMembersCount() - 1);
10851086
CometChatGroupEvents.ccGroupLeft.next({
10861087
userLeft: CometChatUIKitUtility.clone(loggedInUser),
10871088
leftGroup: groupClone,
@@ -1370,6 +1371,11 @@ function CometChatHome(props: { theme?: string }) {
13701371
const ccOpenChat = CometChatUIEvents.ccOpenChat.subscribe((item) => {
13711372
openChatForUser(item.user);
13721373
})
1374+
const ccGroupJoineed = CometChatGroupEvents.ccGroupMemberJoined.subscribe((data: IGroupMemberJoined) => {
1375+
setGroup(data.joinedGroup)
1376+
setSelectedItem(data.joinedGroup);
1377+
setAppState({ type: "updateSelectedItemGroup", payload: data.joinedGroup });
1378+
})
13731379

13741380
const ccClickEvent = CometChatUIEvents.ccMouseEvent.subscribe((mouseevent: IMouseEvent) => {
13751381
if (mouseevent.event.type === "click" && (mouseevent.body as { CometChatUserGroupMembersObject: User })?.CometChatUserGroupMembersObject) {
@@ -1408,6 +1414,7 @@ function CometChatHome(props: { theme?: string }) {
14081414
ccConversationDeleted?.unsubscribe();
14091415
ccOpenChat?.unsubscribe();
14101416
ccClickEvent?.unsubscribe();
1417+
ccGroupJoineed?.unsubscribe();
14111418
};
14121419
}, [newChat, selectedItem]);
14131420

sample-app/src/components/CometChatJoinGroup/CometChatJoinGroup.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CometChat, Group, GroupType } from "@cometchat/chat-sdk-javascript";
2-
import { useContext, useState } from "react";
2+
import { useContext, useEffect, useRef, useState } from "react";
33
import { AppContext } from "../../context/AppContext";
44
import "../../styles/CometChatSelector/CometChatSelector.css";
55
import { CometChatAvatar, CometChatButton, CometChatGroupEvents, CometChatUIKitLoginListener, getLocalizedString } from "@cometchat/chat-uikit-react";
@@ -20,6 +20,8 @@ export const CometChatJoinGroup = (props: joinPasswordGroupProps) => {
2020
const [showWrongPassword, setShowWrongPassword] = useState(false);
2121
const loggedInUser = CometChatUIKitLoginListener.getLoggedInUser();
2222
const { appState, setAppState } = useContext(AppContext);
23+
const inputRef = useRef<HTMLInputElement>(null);
24+
2325

2426
const onPasswordChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2527
setShowWrongPassword(false);
@@ -52,6 +54,15 @@ export const CometChatJoinGroup = (props: joinPasswordGroupProps) => {
5254
});
5355
}
5456

57+
useEffect(() => {
58+
const timer = setTimeout(() => {
59+
if (inputRef.current) {
60+
inputRef.current.focus();
61+
}
62+
}, 100);
63+
return () => clearTimeout(timer);
64+
}, [group]);
65+
5566
return (
5667
<div className="join-group-password__wrapper">
5768
<div className="join-group-password">
@@ -78,7 +89,7 @@ export const CometChatJoinGroup = (props: joinPasswordGroupProps) => {
7889
<div className="join-group-password__input-label">
7990
{getLocalizedString("group_password")}
8091
</div>
81-
<input placeholder={getLocalizedString("enter_your_password")} value={password} onChange={onPasswordChange} />
92+
<input ref={inputRef} placeholder={getLocalizedString("enter_your_password")} value={password} onChange={onPasswordChange} />
8293
{showWrongPassword && <div className="join-group-password__input-wrong" >
8394
{getLocalizedString("invalid_password")}
8495
</div>}

sample-app/src/metaInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const metaInfo = {
22
name: "sample-app",
3-
version: "6.0.3",
3+
version: "6.0.4",
44
type: "sample",
55
platform: "React",
66
};

src/CometChatUIKit/CometChatUIKit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class CometChatUIKit {
100100
return new Promise((resolve, reject) => {
101101
window.CometChatUiKit = {
102102
name: "@cometchat/chat-uikit-react",
103-
version: "6.0.4",
103+
version: "6.0.5",
104104
};
105105
CometChat.init(uiKitSettings?.appId, appSettings).then(() => {
106106
CometChat.getLoggedinUser().then((user: CometChat.User | null) => {

src/components/BaseComponents/CometChatTextBubble/CometChatTextBubble.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ const CometChatTextBubble = (props: TextBubbleProps) => {
4242
const {
4343
pasteHtml
4444
} = useCometChatTextBubble({ textFormatters });
45+
46+
useEffect(()=>{
47+
setIsExpanded(false)
48+
},[text])
49+
4550
/**
4651
* Check if textFormatters are available
4752
*/

src/components/Calling/CallingExtensionDecorator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export class CallingExtensionDecorator extends DataSourceDecorator {
284284
callBuilder.setCallListener(
285285
new CometChatUIKitCalls.OngoingCallListener({
286286
onCallEndButtonPressed: () => {
287-
CometChatUIEvents.ccShowOngoingCall.next({ child: null });
287+
CometChatUIEvents.ccShowOngoingCall.next({ child: null ,message});
288288
},
289289
})
290290
);
@@ -293,7 +293,7 @@ export class CallingExtensionDecorator extends DataSourceDecorator {
293293
const ongoingCallScreen = (
294294
<CometChatOngoingCall callSettingsBuilder={callBuilder} sessionID={sessionId} callWorkflow={CallWorkflow.directCalling} />
295295
);
296-
CometChatUIEvents.ccShowOngoingCall.next({ child: ongoingCallScreen });
296+
CometChatUIEvents.ccShowOngoingCall.next({ child: ongoingCallScreen ,message});
297297
}
298298

299299

src/components/Calling/CometChatCallButtons/CometChatCallButtons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CometChatSoundManager } from "../../../resources/CometChatSoundManager/
99
import { CometChatUIKitUtility } from "../../../CometChatUIKit/CometChatUIKitUtility";
1010
import {getLocalizedString} from "../../../resources/CometChatLocalize/cometchat-localize";
1111
import { CometChatUIKitConstants } from "../../../constants/CometChatUIKitConstants";
12-
import { MessageStatus } from "../../../Enums/Enums";
12+
import { CallWorkflow, MessageStatus } from "../../../Enums/Enums";
1313
import { CometChatButton } from "../../BaseComponents/CometChatButton/CometChatButton";
1414
import audioCall from "../../../assets/audio_call_button.svg";
1515
import videoCall from "../../../assets/video_call_button.svg";
@@ -462,11 +462,11 @@ const CometChatCallButtons = (props: CallButtonsPropsType) => {
462462
</div>
463463
) : null}
464464
</div>
465-
466465
{showOngoingCall && sessionIdRef.current != null ? (
467466
<CometChatOngoingCall
468467
sessionID={sessionIdRef.current}
469468
callSettingsBuilder={getCallBuilder()}
469+
callWorkflow={activeGroup ? CallWorkflow.directCalling : CallWorkflow.defaultCalling}
470470
/>
471471
) : null}
472472

0 commit comments

Comments
 (0)