Skip to content

Commit 487ffca

Browse files
authored
chore: fix typo with close watcher const (#29146)
The variable was spelled incorrectly.
1 parent c0f5e5e commit 487ffca

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

core/src/components/app/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ComponentInterface } from '@stencil/core';
22
import { Build, Component, Element, Host, Method, h } from '@stencil/core';
33
import type { FocusVisibleUtility } from '@utils/focus-visible';
4-
import { shoudUseCloseWatcher } from '@utils/hardware-back-button';
4+
import { shouldUseCloseWatcher } from '@utils/hardware-back-button';
55
import { printIonWarning } from '@utils/logging';
66
import { isPlatform } from '@utils/platform';
77

@@ -36,15 +36,15 @@ export class App implements ComponentInterface {
3636
import('../../utils/input-shims/input-shims').then((module) => module.startInputShims(config, platform));
3737
}
3838
const hardwareBackButtonModule = await import('../../utils/hardware-back-button');
39-
const supportsHardwareBackButtonEvents = isHybrid || shoudUseCloseWatcher();
39+
const supportsHardwareBackButtonEvents = isHybrid || shouldUseCloseWatcher();
4040
if (config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) {
4141
hardwareBackButtonModule.startHardwareBackButton();
4242
} else {
4343
/**
4444
* If an app sets hardwareBackButton: false and experimentalCloseWatcher: true
4545
* then the close watcher will not be used.
4646
*/
47-
if (shoudUseCloseWatcher()) {
47+
if (shouldUseCloseWatcher()) {
4848
printIonWarning(
4949
'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.'
5050
);

core/src/components/menu/menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
22
import { Build, Component, Element, Event, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
33
import { getTimeGivenProgression } from '@utils/animation/cubic-bezier';
44
import { GESTURE_CONTROLLER } from '@utils/gesture';
5-
import { shoudUseCloseWatcher } from '@utils/hardware-back-button';
5+
import { shouldUseCloseWatcher } from '@utils/hardware-back-button';
66
import type { Attributes } from '@utils/helpers';
77
import { inheritAriaAttributes, assert, clamp, isEndSide as isEnd } from '@utils/helpers';
88
import { menuController } from '@utils/menu-controller';
@@ -788,7 +788,7 @@ export class Menu implements ComponentInterface, MenuI {
788788
*/
789789
return (
790790
<Host
791-
onKeyDown={shoudUseCloseWatcher() ? null : this.onKeydown}
791+
onKeyDown={shouldUseCloseWatcher() ? null : this.onKeydown}
792792
role="navigation"
793793
aria-label={inheritedAttributes['aria-label'] || 'menu'}
794794
class={{

core/src/utils/hardware-back-button.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface HandlerRegister {
3030
* moment this file is evaluated which could be
3131
* before the config is set.
3232
*/
33-
export const shoudUseCloseWatcher = () =>
33+
export const shouldUseCloseWatcher = () =>
3434
config.get('experimentalCloseWatcher', false) && win !== undefined && 'CloseWatcher' in win;
3535

3636
/**
@@ -109,7 +109,7 @@ export const startHardwareBackButton = () => {
109109
* backbutton event otherwise we may get duplicate
110110
* events firing.
111111
*/
112-
if (shoudUseCloseWatcher()) {
112+
if (shouldUseCloseWatcher()) {
113113
let watcher: CloseWatcher | undefined;
114114

115115
const configureWatcher = () => {

core/src/utils/overlays.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { doc } from '@utils/browser';
22
import type { BackButtonEvent } from '@utils/hardware-back-button';
3-
import { shoudUseCloseWatcher } from '@utils/hardware-back-button';
3+
import { shouldUseCloseWatcher } from '@utils/hardware-back-button';
44

55
import { config } from '../global/config';
66
import { getIonMode } from '../global/ionic-global';
@@ -428,7 +428,7 @@ const connectListeners = (doc: Document) => {
428428
* this behavior will be handled via the ionBackButton
429429
* event.
430430
*/
431-
if (!shoudUseCloseWatcher()) {
431+
if (!shouldUseCloseWatcher()) {
432432
doc.addEventListener('keydown', (ev) => {
433433
if (ev.key === 'Escape') {
434434
const lastOverlay = getPresentedOverlay(doc);

0 commit comments

Comments
 (0)