Skip to content

Commit 88c4503

Browse files
committed
test
1 parent 4aec1a4 commit 88c4503

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { CommunicationIdentifierKind } from '@azure/communication-common';
1313
import { EnvironmentInfo } from '@azure/communication-calling';
1414
/* @conditional-compile-remove(breakout-rooms) */ /* @conditional-compile-remove(media-access) */
1515
import { CallNotifications } from '@internal/calling-stateful-client';
16+
import { _safeJSONStringify } from '@internal/acs-ui-common';
1617
/**
1718
* @private
1819
*/
@@ -105,7 +106,14 @@ const memoizeState = memoizeOne(
105106
})
106107
);
107108

108-
const memoizeCalls = memoizeOne((call?: CallState): { [key: string]: CallState } => (call ? { [call.id]: call } : {}));
109+
const isCallEqual = (newArgs: any[], lastArgs: any[]): boolean => {
110+
return _safeJSONStringify(newArgs) === _safeJSONStringify(lastArgs);
111+
};
112+
113+
const memoizeCalls = memoizeOne(
114+
(call?: CallState): { [key: string]: CallState } => (call ? { [call.id]: call } : {}),
115+
isCallEqual
116+
);
109117

110118
const adaptCompositeState = (compositeState: CallAdapterState): CallClientState => {
111119
return memoizeState(

0 commit comments

Comments
 (0)