diff --git a/app/components/editor-plugins/regulatory-statements/sidebar-insert.js b/app/components/editor-plugins/regulatory-statements/sidebar-insert.js index 8596f4821..db38667a9 100644 --- a/app/components/editor-plugins/regulatory-statements/sidebar-insert.js +++ b/app/components/editor-plugins/regulatory-statements/sidebar-insert.js @@ -5,7 +5,6 @@ import { action } from '@ember/object'; export default class RegulatoryStatementsSidebarInsertComponent extends Component { @tracked isDisabled = false; @tracked modalEnabled = false; - @tracked besluit; constructor() { super(...arguments); @@ -13,11 +12,14 @@ export default class RegulatoryStatementsSidebarInsertComponent extends Componen this.update(); } - update() { - this.besluit = this.args.controller.datastore + get besluit() { + return this.args.controller.datastore .match(null, 'a', `besluit:Besluit`) .asSubjectNodes() .next().value; + } + + update() { this.isDisabled = !this.besluit; }