async ngOnChanges()

in frontend/src/app/customer-service-agent/case-history/case-history.component.ts [95:117]


  async ngOnChanges() {
    this.filteredOptions = this.languageControl.valueChanges.pipe(
      startWith(''),
      map(value => {
        const name = typeof value === 'string' ? value : value?.name;
        return name ? this._filter(name as string) : this.translationOptions.slice();
      }),
    );
    this.cases = await Promise.all(this.caseHistory.map(async (conversation: Conversation) => {
      if (conversation.summary) {
        const translateRes: any = await firstValueFrom(this.customerServiceAgentService.translateText(conversation.summary, this.agentLanguage))
        conversation.summary = translateRes.output_text;
      }
      if (conversation.title) {
        const translateRes: any = await firstValueFrom(this.customerServiceAgentService.translateText(conversation.title, this.agentLanguage))
        conversation.title = translateRes.output_text;
      }

      return conversation;
    }));


  }