Skip to content

Commit

Permalink
Send ownerId in onReady event
Browse files Browse the repository at this point in the history
  • Loading branch information
esme committed Aug 5, 2024
1 parent 8d9dc2c commit b0fa35d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions demos/demo-react-ts/src/hooks/useCti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const useCti = (
engagementId?: number;
portalId?: number;
userId?: number;
ownerId?: number;
}) => {
const engagementId = (data && data.engagementId) || 0;

Expand Down
2 changes: 1 addition & 1 deletion src/CallingExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CallingExtensions {
initialized(userData) {
this.sendMessage({
type: messageType.INITIALIZED,
data: { ...userData },
data: userData,
});
}

Expand Down
11 changes: 7 additions & 4 deletions src/IFrameManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ class IFrameManager {

onMessage(event) {
const { data, origin } = event;
const {
type, engagementId, portalId, userId,
} = event.data;
const { type, engagementId, portalId, userId, ownerId } = event.data;
if (type === messageType.SYNC) {
// The iFrame host can send this message multiple times, don't respond more than once
if (!this.isReady) {
Expand All @@ -200,7 +198,12 @@ class IFrameManager {
this.destinationHost = hostUrl || this.destinationHost;
this.logDebugMessage(prefix, debugMessageType.FROM_HUBSPOT, type, data);
this.sendMessage(message);
this.onReady({ engagementId, portalId, userId });
this.onReady({
engagementId,
portalId,
userId,
ownerId,
});
}
return;
}
Expand Down

0 comments on commit b0fa35d

Please sign in to comment.