Skip to content

Commit

Permalink
Merge pull request #400 from gilest/fix/navigator-access
Browse files Browse the repository at this point in the history
Avoid Fastboot crash when accessing `navigator` global
  • Loading branch information
lukemelia authored Jun 28, 2024
2 parents 8cfea65 + fb5b6df commit 6c6906d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = {
env: {
browser: true,
},
globals: {
globalThis: 'readonly',
},
rules: {
'no-setter-return': 'off',
'ember/classic-decorator-no-classic-methods': 'warn',
Expand Down
4 changes: 3 additions & 1 deletion addon/utils/config-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export function getDestinationElementIdFromConfig(config) {
return modalContainerId;
}

export const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
export const isIOS =
(globalThis.navigator || false) &&
/iPad|iPhone|iPod/.test(navigator.userAgent);

export function clickHandlerDelay(component) {
let ENV = getOwner(component).resolveRegistration('config:environment');
Expand Down

0 comments on commit 6c6906d

Please sign in to comment.