Skip to content

Commit 10e9558

Browse files
committed
Fix click-to-call button insert
1 parent cd082c6 commit 10e9558

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pipedrive-embeddable-ringcentral-phone-spa",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "Add RingCentral Embeddable Voice widgets to Pipedrive",
55
"keywords": [
66
"RingCentral",

src/config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ export const insertClickToCallButton = [
5959
// support async
6060
getContactPhoneNumbers: async () => {
6161
let phones = document.querySelectorAll('.viewContainer:not([style*="none"]) [data-test="phone-label"]')
62-
return Array.from(phones).map(p => {
63-
let title = p.parentNode.nextSibling.textContent.trim()
62+
return Array.from(phones).map((p, i) => {
63+
let n = p.parentNode.nextSibling || p.nextSibling
64+
if (!n) {
65+
return null
66+
}
67+
let title = n ? n.textContent.trim() : 'Direct' + i
6468
let id = title
6569
let number = p.textContent.trim()
6670
if (checkPhoneNumber(number)) {

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ringcentral Embeddable Widgets for Pipedrive",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "Add RingCentral Embeddable Voice widgets to Pipedrive",
55
"permissions": [
66
"http://*/",

0 commit comments

Comments
 (0)