From 6d66813f9503e5946ff1c2dced0211f496201254 Mon Sep 17 00:00:00 2001 From: simonihmig Date: Sun, 25 Oct 2020 15:50:00 +0100 Subject: [PATCH] Add FastBoot guard to LinkComponent's EventDispatcher lookup --- .../-internals/glimmer/lib/components/link-to.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/@ember/-internals/glimmer/lib/components/link-to.ts b/packages/@ember/-internals/glimmer/lib/components/link-to.ts index 0494e4a6674..3f7540004ab 100644 --- a/packages/@ember/-internals/glimmer/lib/components/link-to.ts +++ b/packages/@ember/-internals/glimmer/lib/components/link-to.ts @@ -11,6 +11,7 @@ import { inject as injectService } from '@ember/service'; import { DEBUG } from '@glimmer/env'; import EmberComponent, { HAS_BLOCK } from '../component'; import layout from '../templates/link-to'; +import { EmberVMEnvironment } from '../environment'; /** The `LinkTo` component renders a link to the supplied `routeName` passing an optionally @@ -494,9 +495,12 @@ const LinkComponent = EmberComponent.extend({ // As our EventDispatcher adds event listeners lazily, and does not recognize the dynamic event pattern here, // we must tell it explicitly that we need to listen to `eventName` events - let eventDispatcher = getOwner(this).lookup('event_dispatcher:main'); - if (eventDispatcher) { - eventDispatcher.setupHandlerForEmberEvent(eventName); + let owner = getOwner(this); + if (owner.lookup('-environment:main')!.isInteractive) { + let eventDispatcher = owner.lookup('event_dispatcher:main'); + if (eventDispatcher) { + eventDispatcher.setupHandlerForEmberEvent(eventName); + } } },