Revert AbortController polyfill to use native AbortController

This commit is contained in:
Michael Lange 2020-06-24 20:46:30 -07:00
parent b234b1cefd
commit f6fa2c6088
1 changed files with 7 additions and 2 deletions

View File

@ -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