github.com/hernad/nomad@v1.6.112/ui/app/routes/allocations/allocation/index.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import Route from '@ember/routing/route';
     7  
     8  export default class IndexRoute extends Route {
     9    setupController(controller, model) {
    10      // Suppress the preemptedByAllocation fetch error in the event it's a 404
    11      if (model) {
    12        const setPreempter = () =>
    13          controller.set('preempter', model.preemptedByAllocation);
    14        model.preemptedByAllocation.then(setPreempter, setPreempter);
    15      }
    16  
    17      return super.setupController(...arguments);
    18    }
    19  
    20    resetController(controller, isExiting) {
    21      if (isExiting) {
    22        controller.watchNext.cancelAll();
    23      }
    24    }
    25  }