Skip to content

Commit

Permalink
chore: fix typo with close watcher const (#29146)
Browse files Browse the repository at this point in the history
The variable was spelled incorrectly.
  • Loading branch information
liamdebeasi authored Mar 12, 2024
1 parent c0f5e5e commit 487ffca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions core/src/components/app/app.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -36,15 +36,15 @@ 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 {
/**
* 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.'
);
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -788,7 +788,7 @@ export class Menu implements ComponentInterface, MenuI {
*/
return (
<Host
onKeyDown={shoudUseCloseWatcher() ? null : this.onKeydown}
onKeyDown={shouldUseCloseWatcher() ? null : this.onKeydown}
role="navigation"
aria-label={inheritedAttributes['aria-label'] || 'menu'}
class={{
Expand Down
4 changes: 2 additions & 2 deletions core/src/utils/hardware-back-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface HandlerRegister {
* moment this file is evaluated which could be
* before the config is set.
*/
export const shoudUseCloseWatcher = () =>
export const shouldUseCloseWatcher = () =>
config.get('experimentalCloseWatcher', false) && win !== undefined && 'CloseWatcher' in win;

/**
Expand Down Expand Up @@ -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 = () => {
Expand Down
4 changes: 2 additions & 2 deletions core/src/utils/overlays.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 487ffca

Please sign in to comment.