Skip to content

Commit edf6045

Browse files
authored
Fix handleOpenURL spelling. (#4758)
1 parent c9ae97c commit edf6045

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

packages-exp/auth-exp/src/platform_cordova/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface CordovaWindow extends Window {
4242
readonly displayName: string;
4343
};
4444

45-
handleOpenUrl(url: string): void;
45+
handleOpenURL(url: string): void;
4646
}
4747

4848
export interface InAppBrowserRef {

packages-exp/auth-exp/src/platform_cordova/popup_redirect/popup_redirect.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,18 @@ describe('platform_cordova/popup_redirect/popup_redirect', () => {
228228
});
229229
});
230230

231-
context('when using global handleOpenUrl callback', () => {
231+
context('when using global handleOpenURL callback', () => {
232232
it('ignores inbound callbacks that are not for this app', async () => {
233233
await resolver._initialize(auth);
234-
win.handleOpenUrl(`${NOT_PACKAGE_NAME}://foo`);
234+
win.handleOpenURL(`${NOT_PACKAGE_NAME}://foo`);
235235

236236
// Clear timeout is called in the handler so we can check that
237237
expect(win.clearTimeout).not.to.have.been.called;
238238
});
239239

240240
it('passes through callback if package name matches', async () => {
241241
await resolver._initialize(auth);
242-
win.handleOpenUrl(`${PACKAGE_NAME}://foo`);
242+
win.handleOpenURL(`${PACKAGE_NAME}://foo`);
243243
expect(win.clearTimeout).to.have.been.calledWith(NO_EVENT_TIMER_ID);
244244
});
245245

@@ -256,32 +256,32 @@ describe('platform_cordova/popup_redirect/popup_redirect', () => {
256256

257257
const promise = event(await resolver._initialize(auth));
258258
eventsStubs._eventFromPartialAndUrl!.returns(finalEvent as AuthEvent);
259-
win.handleOpenUrl(`${PACKAGE_NAME}://foo`);
259+
win.handleOpenURL(`${PACKAGE_NAME}://foo`);
260260
expect(await promise).to.eq(finalEvent);
261261
expect(events._eventFromPartialAndUrl).to.have.been.calledWith(
262262
{ type: AuthEventType.REAUTH_VIA_REDIRECT },
263263
`${PACKAGE_NAME}://foo`
264264
);
265265
});
266266

267-
it('calls the dev existing handleOpenUrl function', async () => {
268-
const oldHandleOpenUrl = sinon.stub();
269-
win.handleOpenUrl = oldHandleOpenUrl;
267+
it('calls the dev existing handleOpenURL function', async () => {
268+
const oldHandleOpenURL = sinon.stub();
269+
win.handleOpenURL = oldHandleOpenURL;
270270

271271
await resolver._initialize(auth);
272-
win.handleOpenUrl(`${PACKAGE_NAME}://foo`);
273-
expect(oldHandleOpenUrl).to.have.been.calledWith(
272+
win.handleOpenURL(`${PACKAGE_NAME}://foo`);
273+
expect(oldHandleOpenURL).to.have.been.calledWith(
274274
`${PACKAGE_NAME}://foo`
275275
);
276276
});
277277

278-
it('calls the dev existing handleOpenUrl function for other package', async () => {
279-
const oldHandleOpenUrl = sinon.stub();
280-
win.handleOpenUrl = oldHandleOpenUrl;
278+
it('calls the dev existing handleOpenURL function for other package', async () => {
279+
const oldHandleOpenURL = sinon.stub();
280+
win.handleOpenURL = oldHandleOpenURL;
281281

282282
await resolver._initialize(auth);
283-
win.handleOpenUrl(`${NOT_PACKAGE_NAME}://foo`);
284-
expect(oldHandleOpenUrl).to.have.been.calledWith(
283+
win.handleOpenURL(`${NOT_PACKAGE_NAME}://foo`);
284+
expect(oldHandleOpenURL).to.have.been.calledWith(
285285
`${NOT_PACKAGE_NAME}://foo`
286286
);
287287
});

packages-exp/auth-exp/src/platform_cordova/popup_redirect/popup_redirect.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class CordovaPopupRedirectResolver implements PopupRedirectResolverInternal {
111111
manager: AuthEventManager
112112
): void {
113113
// Get the global plugins
114-
const { universalLinks, handleOpenUrl, BuildInfo } = _cordovaWindow();
114+
const { universalLinks, handleOpenURL, BuildInfo } = _cordovaWindow();
115115

116116
const noEventTimeout = setTimeout(async () => {
117117
// We didn't see that initial event. Clear any pending object and
@@ -149,18 +149,18 @@ class CordovaPopupRedirectResolver implements PopupRedirectResolverInternal {
149149
// For this to work, cordova-plugin-customurlscheme needs to be installed.
150150
// https://github.com/EddyVerbruggen/Custom-URL-scheme
151151
// Do not overwrite the existing developer's URL handler.
152-
const existingHandleOpenUrl = handleOpenUrl;
152+
const existingHandleOpenURL = handleOpenURL;
153153
const packagePrefix = `${BuildInfo.packageName.toLowerCase()}://`;
154-
_cordovaWindow().handleOpenUrl = async url => {
154+
_cordovaWindow().handleOpenURL = async url => {
155155
if (url.toLowerCase().startsWith(packagePrefix)) {
156156
// We want this intentionally to float
157157
// eslint-disable-next-line @typescript-eslint/no-floating-promises
158158
universalLinksCb({ url });
159159
}
160160
// Call the developer's handler if it is present.
161-
if (typeof existingHandleOpenUrl === 'function') {
161+
if (typeof existingHandleOpenURL === 'function') {
162162
try {
163-
existingHandleOpenUrl(url);
163+
existingHandleOpenURL(url);
164164
} catch (e) {
165165
// This is a developer error. Don't stop the flow of the SDK.
166166
console.error(e);

0 commit comments

Comments
 (0)