cometchat / chat-sdk-javascript

Voice & Video Calling and Text Chat SDK for JavaScript/Web
Other
30 stars 24 forks source link

Changed the data type getUnreadMessageCount() and setUnreadMessageCou… #78

Closed yemiwebby closed 4 years ago

yemiwebby commented 4 years ago

While building an Angular application and using the Angular UI Chat kit, I was forced to use two different versions trying to fix the issue with the snippet below, as extracted from the terminal. I did some digging and realized that a particular component within the UI kit wasn't compiling because of the data type specified for these two [setUnreadMessageCount() and getUnreadMessageCount()] methods within the SDK.

` ERROR in src/lib/cometchat-angular-ui-kit/src/lib/conversations-list/conversations-list.component.ts:100:72 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

100 updatedConversation.setUnreadMessageCount(parseInt(conversation.getUnreadMessageCount()) + 1);

src/lib/cometchat-angular-ui-kit/src/lib/conversations-list/conversations-list.component.ts:129:72 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

129                     updatedConversation.setUnreadMessageCount(parseInt(conversation.getUnreadMessageCount()) + 1);

src/lib/cometchat-angular-ui-kit/src/lib/conversations-list/conversations-list.component.ts:245:68 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

245 updatedConversation.setUnreadMessageCount(parseInt(conversation.getUnreadMessageCount()) + 1);


`
mayur-bhandari commented 4 years ago

Hello @yemiwebby ,

This is not an issue at the SDK level but an issue in the Angular UI Kit. The getUnreadMessageCount() will return a number and not a string. So there is no need for parseInt(). Please create an issue in the Angular UI Kit repository.

Angular UI Kit: https://github.com/cometchat-pro/javascript-angular-chat-ui-kit