From 487ffca11e01100517e030b401367f46b0d8cda4 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 12 Mar 2024 17:52:38 -0400 Subject: [PATCH] chore: fix typo with close watcher const (#29146) The variable was spelled incorrectly. --- core/src/components/app/app.tsx | 6 +++--- core/src/components/menu/menu.tsx | 4 ++-- core/src/utils/hardware-back-button.ts | 4 ++-- core/src/utils/overlays.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/components/app/app.tsx b/core/src/components/app/app.tsx index 44a67d2a15..d38b0bd37a 100644 --- a/core/src/components/app/app.tsx +++ b/core/src/components/app/app.tsx @@ -1,7 +1,7 @@ import type { ComponentInterface } from '@stencil/core'; import { Build, Component, Element, Host, Method, h } from '@stencil/core'; import type { FocusVisibleUtility } from '@utils/focus-visible'; -import { shoudUseCloseWatcher } from '@utils/hardware-back-button'; +import { shouldUseCloseWatcher } from '@utils/hardware-back-button'; import { printIonWarning } from '@utils/logging'; import { isPlatform } from '@utils/platform'; @@ -36,7 +36,7 @@ export class App implements ComponentInterface { import('../../utils/input-shims/input-shims').then((module) => module.startInputShims(config, platform)); } const hardwareBackButtonModule = await import('../../utils/hardware-back-button'); - const supportsHardwareBackButtonEvents = isHybrid || shoudUseCloseWatcher(); + const supportsHardwareBackButtonEvents = isHybrid || shouldUseCloseWatcher(); if (config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) { hardwareBackButtonModule.startHardwareBackButton(); } else { @@ -44,7 +44,7 @@ export class App implements ComponentInterface { * If an app sets hardwareBackButton: false and experimentalCloseWatcher: true * then the close watcher will not be used. */ - if (shoudUseCloseWatcher()) { + if (shouldUseCloseWatcher()) { printIonWarning( 'experimentalCloseWatcher was set to `true`, but hardwareBackButton was set to `false`. Both config options must be `true` for the Close Watcher API to be used.' ); diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 437c536345..a7bcc2573c 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -2,7 +2,7 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core'; import { Build, Component, Element, Event, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core'; import { getTimeGivenProgression } from '@utils/animation/cubic-bezier'; import { GESTURE_CONTROLLER } from '@utils/gesture'; -import { shoudUseCloseWatcher } from '@utils/hardware-back-button'; +import { shouldUseCloseWatcher } from '@utils/hardware-back-button'; import type { Attributes } from '@utils/helpers'; import { inheritAriaAttributes, assert, clamp, isEndSide as isEnd } from '@utils/helpers'; import { menuController } from '@utils/menu-controller'; @@ -788,7 +788,7 @@ export class Menu implements ComponentInterface, MenuI { */ return ( +export const shouldUseCloseWatcher = () => config.get('experimentalCloseWatcher', false) && win !== undefined && 'CloseWatcher' in win; /** @@ -109,7 +109,7 @@ export const startHardwareBackButton = () => { * backbutton event otherwise we may get duplicate * events firing. */ - if (shoudUseCloseWatcher()) { + if (shouldUseCloseWatcher()) { let watcher: CloseWatcher | undefined; const configureWatcher = () => { diff --git a/core/src/utils/overlays.ts b/core/src/utils/overlays.ts index b248206151..dfc17ca327 100644 --- a/core/src/utils/overlays.ts +++ b/core/src/utils/overlays.ts @@ -1,6 +1,6 @@ import { doc } from '@utils/browser'; import type { BackButtonEvent } from '@utils/hardware-back-button'; -import { shoudUseCloseWatcher } from '@utils/hardware-back-button'; +import { shouldUseCloseWatcher } from '@utils/hardware-back-button'; import { config } from '../global/config'; import { getIonMode } from '../global/ionic-global'; @@ -428,7 +428,7 @@ const connectListeners = (doc: Document) => { * this behavior will be handled via the ionBackButton * event. */ - if (!shoudUseCloseWatcher()) { + if (!shouldUseCloseWatcher()) { doc.addEventListener('keydown', (ev) => { if (ev.key === 'Escape') { const lastOverlay = getPresentedOverlay(doc);