From d089bd014258d0882e2bfd043c28017d057c61a8 Mon Sep 17 00:00:00 2001 From: Embbnux Ji Date: Mon, 2 Oct 2023 09:46:02 -0700 Subject: [PATCH] fix: address book loading issue at next page (#710) * fix: address book loadding issue at next page * version 1.9.2 * fix: default host for connection check at extension build --- package.json | 2 +- src/modules/AddressBook/index.ts | 2 ++ src/modules/Phone/index.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e3fc82808..e6414f3b9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/modules/AddressBook/index.ts b/src/modules/AddressBook/index.ts index f1e4a0962..b4cda006b 100644 --- a/src/modules/AddressBook/index.ts +++ b/src/modules/AddressBook/index.ts @@ -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 diff --git a/src/modules/Phone/index.js b/src/modules/Phone/index.js index a5406c166..e5812baec 100644 --- a/src/modules/Phone/index.js +++ b/src/modules/Phone/index.js @@ -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}`); }, }, }