Skip to content

Commit

Permalink
fix: disposition undefined issue (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux authored Sep 9, 2024
1 parent 40945b6 commit de9c385
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const {
enablePopup,
popupPageUri,
jwt,
hideCallNote,
} = parseUri(paramsUri);

function obj2uri(obj) {
Expand All @@ -58,6 +59,7 @@ const appUri = `${appUrl}?${obj2uri({
fromAdapter: 1,
fromPopup,
jwt,
hideCallNote,
_t: Date.now(),
})}`;

Expand Down
31 changes: 31 additions & 0 deletions src/modules/EvCallDisposition/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Module } from '@ringcentral-integration/commons/lib/di';

import { EvCallDisposition as BaseEvCallDisposition } from '@ringcentral-integration/engage-voice-widgets/modules/EvCallDisposition';

@Module({
deps: [],
})
class EvCallDisposition extends BaseEvCallDisposition {
// override to fix call disposition undefined issue.
override disposeCall(id: string) {
const call = this._deps.evCallHistory.callsMapping[id];
const callDisposition = this.callsMapping[id];
if (!callDisposition) {
return;
}
const isDisposed =
this.dispositionStateMapping[id] &&
this.dispositionStateMapping[id].disposed;
if (!call.outdialDispositions || isDisposed) return;

this._deps.evClient.dispositionCall({
uii: call.uii,
dispId: callDisposition.dispositionId,
notes: callDisposition.notes,
});

this.setDispositionState(id, { disposed: true });
}
}

export { EvCallDisposition };
2 changes: 1 addition & 1 deletion src/modules/Phone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { EvActiveCallListUI } from '@ringcentral-integration/engage-voice-widget
import { EvAgentScript } from '@ringcentral-integration/engage-voice-widgets/modules/EvAgentScript';
// import { EvAuth } from '@ringcentral-integration/engage-voice-widgets/modules/EvAuth';
import { EvCallDataSource } from '@ringcentral-integration/engage-voice-widgets/modules/EvCallDataSource';
import { EvCallDisposition } from '@ringcentral-integration/engage-voice-widgets/modules/EvCallDisposition';
import { EvCallMonitor } from '@ringcentral-integration/engage-voice-widgets/modules/EvCallMonitor';
import { EvDialerUI } from '@ringcentral-integration/engage-voice-widgets/modules/EvDialerUI';
import { EvManualDialSettingsUI } from '@ringcentral-integration/engage-voice-widgets/modules/EvManualDialSettingsUI';
Expand Down Expand Up @@ -67,6 +66,7 @@ import OAuth from '../OAuth';
import { Adapter } from '../Adapter';
import { ThirdPartyService } from '../ThirdPartyService';
import { EvCall } from '../EvCall';
import { EvCallDisposition } from '../EvCallDisposition';
import { EvActivityCallUI } from '../EvActivityCallUI';
import { EvCallHistoryUI } from '../EvCallHistoryUI';
import { EvCallHistory } from '../EvCallHistory';
Expand Down

0 comments on commit de9c385

Please sign in to comment.