Skip to content

Commit

Permalink
Merge pull request #20 from cometchat-pro/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
TirathBhuva authored Jun 30, 2021
2 parents 8d69fcd + 4263ceb commit 6046281
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cometchat-pro-react-native-ui-kit",
"version": "2.3.4-1",
"version": "2.3.4-2",
"description": "Chat UI Kit for React Native App",
"main": "./src/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/components/Calls/CometChatOutgoingCall/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CometChatOutgoingCall extends React.PureComponent {

this.callScreenManager = null;
this.theme = { ...theme, ...this.props.theme };

this.outgoingAlert = new Sound(outgoingCallAlert);
}

Expand Down
2 changes: 2 additions & 0 deletions src/components/Calls/CometChatOutgoingDirectCall/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class CometChatOutgoingDirectCall extends React.Component {
this.props.close();
},
onError: (error) => {
this.props.actionGenerated(actions.CALL_ERROR, error);

console.log('Call Error: ', error);
},
});
Expand Down
31 changes: 13 additions & 18 deletions src/components/Chats/CometChatConversationList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class CometChatConversationList extends React.Component {
};
this.chatListRef = React.createRef();
this.theme = { ...theme, ...this.props.theme };

this.audio = new Sound(incomingOtherMessageAlert);
this.UIKitSettingsBuilder = new UIKitSettings();
}
Expand Down Expand Up @@ -76,7 +77,8 @@ class CometChatConversationList extends React.Component {
}

checkRestrictions = async () => {
let isMessagesSoundEnabled = await this.context.FeatureRestriction.isMessagesSoundEnabled();
let isMessagesSoundEnabled =
await this.context.FeatureRestriction.isMessagesSoundEnabled();
this.setState({ isMessagesSoundEnabled });
};

Expand Down Expand Up @@ -183,11 +185,8 @@ class CometChatConversationList extends React.Component {
const message = this.props.messageToMarkRead;
this.makeConversation(message)
.then((response) => {
const {
conversationKey,
conversationObj,
conversationList,
} = response;
const { conversationKey, conversationObj, conversationList } =
response;

if (conversationKey > -1) {
const unreadMessageCount = this.makeUnreadMessageCount(
Expand Down Expand Up @@ -584,9 +583,8 @@ class CometChatConversationList extends React.Component {
const { conversationKey, conversationObj, conversationList } = response;

if (conversationKey > -1) {
const unreadMessageCount = this.makeUnreadMessageCount(
conversationObj,
);
const unreadMessageCount =
this.makeUnreadMessageCount(conversationObj);
const lastMessageObj = this.makeLastMessage(message, conversationObj);

const conversationWithObj = { ...conversationObj.conversationWith };
Expand Down Expand Up @@ -654,9 +652,8 @@ class CometChatConversationList extends React.Component {
conversationList.splice(conversationKey, 1);
this.setState({ conversationList: conversationList });
} else {
const unreadMessageCount = this.makeUnreadMessageCount(
conversationObj,
);
const unreadMessageCount =
this.makeUnreadMessageCount(conversationObj);
const lastMessageObj = this.makeLastMessage(
message,
conversationObj,
Expand Down Expand Up @@ -700,9 +697,8 @@ class CometChatConversationList extends React.Component {
const { conversationKey, conversationObj, conversationList } = response;

if (conversationKey > -1) {
const unreadMessageCount = this.makeUnreadMessageCount(
conversationObj,
);
const unreadMessageCount =
this.makeUnreadMessageCount(conversationObj);
const lastMessageObj = this.makeLastMessage(message, conversationObj);

const conversationWithObj = { ...conversationObj.conversationWith };
Expand Down Expand Up @@ -749,9 +745,8 @@ class CometChatConversationList extends React.Component {
const { conversationKey, conversationObj, conversationList } = response;
if (conversationKey > -1) {
if (options && this.loggedInUser.uid !== options.user.uid) {
const unreadMessageCount = this.makeUnreadMessageCount(
conversationObj,
);
const unreadMessageCount =
this.makeUnreadMessageCount(conversationObj);
const lastMessageObj = this.makeLastMessage(
message,
conversationObj,
Expand Down
9 changes: 6 additions & 3 deletions src/components/Messages/CometChatMessageComposer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ export default class CometChatMessageComposer extends React.PureComponent {
}

checkRestrictions = async () => {
let isLiveReactionsEnabled = await this.context.FeatureRestriction.isLiveReactionsEnabled();
let isTypingIndicatorsEnabled = await this.context.FeatureRestriction.isTypingIndicatorsEnabled();
let isSmartRepliesEnabled = await this.context.FeatureRestriction.isSmartRepliesEnabled();
let isLiveReactionsEnabled =
await this.context.FeatureRestriction.isLiveReactionsEnabled();
let isTypingIndicatorsEnabled =
await this.context.FeatureRestriction.isTypingIndicatorsEnabled();
let isSmartRepliesEnabled =
await this.context.FeatureRestriction.isSmartRepliesEnabled();
this.setState({
restrictions: {
isLiveReactionsEnabled,
Expand Down
1 change: 1 addition & 0 deletions src/components/Users/CometChatUserList/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class UserListManager {

constructor(searchKey) {
this.searchKey = searchKey;
this.initializeUsersRequest();
}

initializeUsersRequest = () => {
Expand Down

0 comments on commit 6046281

Please sign in to comment.