Skip to content

Commit 09ba04e

Browse files
fix: retrieve message limit from public settings endpoint
1 parent 97712fe commit 09ba04e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/api/src/EmbeddedChatApi.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ export default class EmbeddedChatApi {
618618
}
619619
}
620620

621-
622621
async sendTypingStatus(username: string, typing: boolean) {
623622
try {
624623
await this.sdk.call(
@@ -897,7 +896,13 @@ export default class EmbeddedChatApi {
897896

898897
async getMessageLimit() {
899898
try {
900-
return await this._restRequest("/v1/settings/Message_MaxAllowedSize");
899+
const response = await this._restRequest(
900+
"/v1/settings.public?_id=Message_MaxAllowedSize"
901+
);
902+
if (response && response.success && response.settings && response.settings.length > 0) {
903+
return response.settings[0];
904+
}
905+
return null;
901906
} catch (err: any) {
902907
console.error(err instanceof Error ? err.message : err);
903908
return err;

0 commit comments

Comments
 (0)