Skip to content

Commit

Permalink
fix: address book loading issue at next page (#710)
Browse files Browse the repository at this point in the history
* fix: address book loadding issue at next page

* version 1.9.2

* fix: default host for connection check at extension build
  • Loading branch information
embbnux authored Oct 2, 2023
1 parent ba93ce1 commit d089bd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ringcentral-embeddable",
"version": "1.9.1",
"version": "1.9.2",
"description": "A RingCentral Embeddable Widget Application",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions src/modules/AddressBook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ export class AddressBook extends AddressBookBase {
let records = [];
let response = await this._fetch(perPage, syncToken);
records = records.concat(response.records ?? []);
let pageNum = 0;
while (response.nextPageId) {
const fetchInterval = pageNum > 3 ? 6000 : 2000;
await sleep(fetchInterval);
response = await this._fetch(perPage, syncToken, response.nextPageId);
records = records.concat(response.records ?? []);
pageNum += 1;
}
if (response.syncInfo!.syncType === 'ISync') {
// @ts-expect-error
Expand Down
3 changes: 2 additions & 1 deletion src/modules/Phone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,8 @@ export function createPhone({
useValue: {
checkConnectionFunc: () => {
const t = Date.now();
return fetch(`${process.env.HOSTING_URL}/assets/images/favicon.ico?=${t}`);
const host = process.env.HOSTING_URL || 'https://ringcentral.github.io/ringcentral-embeddable';
return fetch(`${host}/assets/images/favicon.ico?t=${t}`);
},
},
}
Expand Down

0 comments on commit d089bd0

Please sign in to comment.