diff --git a/addon/components/common/documents/preview.gts b/addon/components/common/documents/preview.gts index 7c07f6d99..4ba84ce35 100644 --- a/addon/components/common/documents/preview.gts +++ b/addon/components/common/documents/preview.gts @@ -14,6 +14,7 @@ import t from 'ember-intl/helpers/t'; import { SayController } from '@lblod/ember-rdfa-editor'; import { PreviewableDocument } from './types'; import { VoteStarUnfilledIcon } from '../vote-star-unfilled-icon'; +import perform from 'ember-concurrency/helpers/perform'; interface Signature { Args: { @@ -31,10 +32,10 @@ export default class DocumentPreview< @tracked controller?: SayController; @tracked isExpanded = false; - @action - onInsert() { + onInsert = task(async () => { + await this.contentTask.perform(); this.args.onInsert(this.args.doc); - } + }); @action togglePreview() { @@ -101,7 +102,7 @@ export default class DocumentPreview<