File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 2424 </div >
2525 {{ /if }}
2626
27- {{ #if @crate .keywords}}
27+ {{ #if this .keywords}}
2828 <ul local-class =" keywords" >
29- {{ #each @crate .keywords as |keyword |}}
29+ {{ #each this .keywords as |keyword |}}
3030 <li >
3131 <LinkTo @route =" keyword" @model ={{ keyword.id }} data-test-keyword ={{ keyword.id }} >
3232 <span local-class =" hash" >#</span >{{ keyword.id }}
Original file line number Diff line number Diff line change 11import { inject as service } from '@ember/service' ;
22import Component from '@glimmer/component' ;
33
4+ import { task } from 'ember-concurrency' ;
5+ import { alias } from 'macro-decorators' ;
6+
47export default class CrateHeader extends Component {
58 @service session ;
69
10+ @alias ( 'loadKeywordsTask.last.value' ) keywords ;
11+
12+ constructor ( ) {
13+ super ( ...arguments ) ;
14+
15+ this . loadKeywordsTask . perform ( ) . catch ( ( ) => {
16+ // ignore all errors and just don't display keywords if the request fails
17+ } ) ;
18+ }
19+
720 get isOwner ( ) {
821 return this . args . crate . owner_user . findBy ( 'id' , this . session . currentUser ?. id ) ;
922 }
23+
24+ loadKeywordsTask = task ( async ( ) => {
25+ return ( await this . args . crate ?. keywords ) ?? [ ] ;
26+ } ) ;
1027}
You can’t perform that action at this time.
0 commit comments