chore: fix typo with close watcher const (#29146)

The variable was spelled incorrectly.
This commit is contained in:
Liam DeBeasi
2024-03-12 17:52:38 -04:00
committed by GitHub
parent c0f5e5ebc0
commit 487ffca11e
4 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import type { ComponentInterface } from '@stencil/core'; import type { ComponentInterface } from '@stencil/core';
import { Build, Component, Element, Host, Method, h } from '@stencil/core'; import { Build, Component, Element, Host, Method, h } from '@stencil/core';
import type { FocusVisibleUtility } from '@utils/focus-visible'; 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 { printIonWarning } from '@utils/logging';
import { isPlatform } from '@utils/platform'; 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)); import('../../utils/input-shims/input-shims').then((module) => module.startInputShims(config, platform));
} }
const hardwareBackButtonModule = await import('../../utils/hardware-back-button'); const hardwareBackButtonModule = await import('../../utils/hardware-back-button');
const supportsHardwareBackButtonEvents = isHybrid || shoudUseCloseWatcher(); const supportsHardwareBackButtonEvents = isHybrid || shouldUseCloseWatcher();
if (config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) { if (config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) {
hardwareBackButtonModule.startHardwareBackButton(); hardwareBackButtonModule.startHardwareBackButton();
} else { } else {
@ -44,7 +44,7 @@ export class App implements ComponentInterface {
* If an app sets hardwareBackButton: false and experimentalCloseWatcher: true * If an app sets hardwareBackButton: false and experimentalCloseWatcher: true
* then the close watcher will not be used. * then the close watcher will not be used.
*/ */
if (shoudUseCloseWatcher()) { if (shouldUseCloseWatcher()) {
printIonWarning( 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.' '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.'
); );

View File

@ -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 { Build, Component, Element, Event, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
import { getTimeGivenProgression } from '@utils/animation/cubic-bezier'; import { getTimeGivenProgression } from '@utils/animation/cubic-bezier';
import { GESTURE_CONTROLLER } from '@utils/gesture'; 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 type { Attributes } from '@utils/helpers';
import { inheritAriaAttributes, assert, clamp, isEndSide as isEnd } from '@utils/helpers'; import { inheritAriaAttributes, assert, clamp, isEndSide as isEnd } from '@utils/helpers';
import { menuController } from '@utils/menu-controller'; import { menuController } from '@utils/menu-controller';
@ -788,7 +788,7 @@ export class Menu implements ComponentInterface, MenuI {
*/ */
return ( return (
<Host <Host
onKeyDown={shoudUseCloseWatcher() ? null : this.onKeydown} onKeyDown={shouldUseCloseWatcher() ? null : this.onKeydown}
role="navigation" role="navigation"
aria-label={inheritedAttributes['aria-label'] || 'menu'} aria-label={inheritedAttributes['aria-label'] || 'menu'}
class={{ class={{

View File

@ -30,7 +30,7 @@ interface HandlerRegister {
* moment this file is evaluated which could be * moment this file is evaluated which could be
* before the config is set. * before the config is set.
*/ */
export const shoudUseCloseWatcher = () => export const shouldUseCloseWatcher = () =>
config.get('experimentalCloseWatcher', false) && win !== undefined && 'CloseWatcher' in win; config.get('experimentalCloseWatcher', false) && win !== undefined && 'CloseWatcher' in win;
/** /**
@ -109,7 +109,7 @@ export const startHardwareBackButton = () => {
* backbutton event otherwise we may get duplicate * backbutton event otherwise we may get duplicate
* events firing. * events firing.
*/ */
if (shoudUseCloseWatcher()) { if (shouldUseCloseWatcher()) {
let watcher: CloseWatcher | undefined; let watcher: CloseWatcher | undefined;
const configureWatcher = () => { const configureWatcher = () => {

View File

@ -1,6 +1,6 @@
import { doc } from '@utils/browser'; import { doc } from '@utils/browser';
import type { BackButtonEvent } from '@utils/hardware-back-button'; 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 { config } from '../global/config';
import { getIonMode } from '../global/ionic-global'; import { getIonMode } from '../global/ionic-global';
@ -428,7 +428,7 @@ const connectListeners = (doc: Document) => {
* this behavior will be handled via the ionBackButton * this behavior will be handled via the ionBackButton
* event. * event.
*/ */
if (!shoudUseCloseWatcher()) { if (!shouldUseCloseWatcher()) {
doc.addEventListener('keydown', (ev) => { doc.addEventListener('keydown', (ev) => {
if (ev.key === 'Escape') { if (ev.key === 'Escape') {
const lastOverlay = getPresentedOverlay(doc); const lastOverlay = getPresentedOverlay(doc);