Skip to content

Commit 03d7967

Browse files
committed
fix: remove additional event listeners for auth success and failure in Iterable class
1 parent 1d74fed commit 03d7967

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/classes/Iterable.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,8 @@ export class Iterable {
918918
IterableEventName.handleCustomActionCalled
919919
);
920920
RNEventEmitter.removeAllListeners(IterableEventName.handleAuthCalled);
921+
RNEventEmitter.removeAllListeners(IterableEventName.handleAuthSuccessCalled);
922+
RNEventEmitter.removeAllListeners(IterableEventName.handleAuthFailureCalled);
921923

922924
if (Iterable.savedConfig.urlHandler) {
923925
RNEventEmitter.addListener(IterableEventName.handleUrlCalled, (dict) => {
@@ -966,7 +968,7 @@ export class Iterable {
966968
// Asks frontend of the client/app to pass authToken
967969
Iterable.savedConfig.authHandler!()
968970
.then((promiseResult) => {
969-
// Promise result can be either just String OR of type AuthResponse.
971+
// Promise result can be either just String OR of type AuthRespronse.
970972
// If type AuthReponse, authToken will be parsed looking for `authToken` within promised object. Two additional listeners will be registered for success and failure callbacks sent by native bridge layer.
971973
// Else it will be looked for as a String.
972974
if (isIterableAuthResponse(promiseResult)) {

0 commit comments

Comments
 (0)