Skip to content

Commit 974e9b2

Browse files
committed
fix: improve URL handling and logging in callUrlHandler;
1 parent 5c2bc6d commit 974e9b2

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/core/utils/callUrlHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ export function callUrlHandler(
1515
url: string,
1616
context: IterableActionContext
1717
) {
18-
// MOB-10424: Figure out if this is purposeful
19-
// eslint-disable-next-line eqeqeq
20-
if (config.urlHandler?.(url, context) == false) {
18+
if (!config.urlHandler?.(url, context)) {
2119
Linking.canOpenURL(url)
2220
.then((canOpen) => {
2321
if (canOpen) {
2422
Linking.openURL(url);
23+
} else {
24+
IterableLogger?.log('Url cannot be opened: ' + url);
2525
}
2626
})
2727
.catch((reason) => {
28-
IterableLogger?.log('could not open url: ' + reason);
28+
IterableLogger?.log('Error opening url: ' + reason);
2929
});
3030
}
3131
}

src/embedded/classes/IterableEmbeddedManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class IterableEmbeddedManager {
5454

5555
constructor(config: IterableConfig) {
5656
this._config = config;
57+
this._isEnabled = config.enableEmbeddedMessaging ?? false;
5758
}
5859

5960
/**
@@ -218,7 +219,7 @@ export class IterableEmbeddedManager {
218219
/**
219220
* Handles a click on an embedded message.
220221
*
221-
* This will fire the correct handers set in the config, and will track the
222+
* This will fire the correct handlers set in the config, and will track the
222223
* click. It should be use on either a button click or a click on the message itself.
223224
*
224225
* @param message - The embedded message.

0 commit comments

Comments
 (0)