diff --git a/app/components/crate-header.js b/app/components/crate-header.js index 4b732844826..a2649804ec0 100644 --- a/app/components/crate-header.js +++ b/app/components/crate-header.js @@ -8,7 +8,6 @@ export default class CrateHeader extends Component { @service session; @alias('loadKeywordsTask.last.value') keywords; - @alias('loadOwnerUserTask.last.value') ownerUser; constructor() { super(...arguments); @@ -16,22 +15,14 @@ export default class CrateHeader extends Component { this.loadKeywordsTask.perform().catch(() => { // ignore all errors and just don't display keywords if the request fails }); - this.loadOwnerUserTask.perform().catch(() => { - // ignore all errors and just don't display settings if the request fails - }); } get isOwner() { - let ownerUser = this.ownerUser ?? []; - let currentUserId = this.session.currentUser?.id; - return ownerUser.some(({ id }) => id === currentUserId); + let userId = this.session.currentUser?.id; + return this.args.crate?.hasOwnerUser(userId) ?? false; } loadKeywordsTask = task(async () => { return (await this.args.crate?.keywords) ?? []; }); - - loadOwnerUserTask = task(async () => { - return (await this.args.crate?.owner_user) ?? []; - }); } diff --git a/app/components/crate-sidebar.hbs b/app/components/crate-sidebar.hbs index c588da07336..aebe8de6371 100644 --- a/app/components/crate-sidebar.hbs +++ b/app/components/crate-sidebar.hbs @@ -94,7 +94,7 @@ {{#unless @crate.categories.isPending}} - {{#if @crate.categories}} + {{#if @crate.categories.length}}

Categories