From 065e50fb07085fb100371374ef71c087218ab97a Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Tue, 2 Jul 2024 11:36:41 -0700 Subject: [PATCH] replace AsyncProcess with TrackedAsyncData equivalent. --- .../sequence-block-details.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/frontend/app/components/curriculum-inventory/sequence-block-details.js b/packages/frontend/app/components/curriculum-inventory/sequence-block-details.js index 45136f32b2..07a4cf7cde 100644 --- a/packages/frontend/app/components/curriculum-inventory/sequence-block-details.js +++ b/packages/frontend/app/components/curriculum-inventory/sequence-block-details.js @@ -1,9 +1,14 @@ import Component from '@glimmer/component'; -import { use } from 'ember-could-get-used-to-this'; -import AsyncProcess from 'ilios-common/classes/async-process'; +import { cached } from '@glimmer/tracking'; +import { TrackedAsyncData } from 'ember-async-data'; export default class CurriculumInventorySequenceBlockDetailsComponent extends Component { - @use allParents = new AsyncProcess(() => [ - this.args.sequenceBlock.getAllParents.bind(this.args.sequenceBlock), - ]); + @cached + get allParentsData() { + return new TrackedAsyncData(this.args.sequenceBlock.getAllParents(this.args.sequenceBlock)); + } + + get allParents() { + return this.allParentsData.isResolved ? this.allParentsData.value : []; + } }