Skip to content

Commit

Permalink
update getChatHistory fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kocherovv committed Mar 4, 2024
1 parent 6f90e36 commit f32c346
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vscode/
node_modules
lib

.*
!/.gitignore
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"mime": "^3.0.0",
"rollup": "^2.79.1"
}
}
}
6 changes: 3 additions & 3 deletions src/utils/MessageAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class MessageAPI {
/**
* Returns history of chat
*/
async getChatHistory(chatId, count) {
async getChatHistory(chatId, count = null) {
CommonUtils.validateChatIdPhoneNumber(chatId, undefined);

const method = 'getChatHistory';
Expand All @@ -321,8 +321,8 @@ class MessageAPI {
'chatId': chatId,
}

if (count && count > 0) {
postData.count = count;
if (count !== null && count > 0) {
postData['count'] = count;
}

this.addChadIdParam(postData, chatId)
Expand Down

0 comments on commit f32c346

Please sign in to comment.