From f6fa2c60888521b347294fc94047c99f2ed1c366 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 24 Jun 2020 20:46:30 -0700 Subject: [PATCH] Revert AbortController polyfill to use native AbortController --- ui/app/components/task-log.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/app/components/task-log.js b/ui/app/components/task-log.js index 61e74b26a..6ee4b2b42 100644 --- a/ui/app/components/task-log.js +++ b/ui/app/components/task-log.js @@ -4,10 +4,15 @@ import { action, computed } from '@ember/object'; import RSVP from 'rsvp'; import { logger } from 'nomad-ui/utils/classes/log'; import timeout from 'nomad-ui/utils/timeout'; -import { AbortController } from 'fetch'; import { classNames } from '@ember-decorators/component'; import classic from 'ember-classic-decorator'; +class MockAbortController { + abort() { + /* noop */ + } +} + @classic @classNames('boxed-section', 'task-log') export default class TaskLog extends Component { @@ -51,7 +56,7 @@ export default class TaskLog extends Component { // If the log request can't settle in one second, the client // must be unavailable and the server should be used instead - const aborter = new AbortController(); + const aborter = window.AbortController ? new AbortController() : new MockAbortController(); const timing = this.useServer ? this.serverTimeout : this.clientTimeout; // Capture the state of useServer at logger create time to avoid a race