Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication: Update thread when switching reply context #9842

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { PostingContentPart, ReferenceType } from '../../metis.util';
import { FileService } from 'app/shared/http/file.service';

Expand Down Expand Up @@ -26,7 +26,7 @@ import { AccountService } from 'app/core/auth/account.service';
templateUrl: './posting-content-part.component.html',
styleUrls: ['./../../metis.component.scss'],
})
export class PostingContentPartComponent implements OnInit {
export class PostingContentPartComponent implements OnChanges, OnInit {
@Input() postingContentPart: PostingContentPart;
@Output() userReferenceClicked = new EventEmitter<string>();
@Output() channelReferenceClicked = new EventEmitter<number>();
Expand Down Expand Up @@ -54,10 +54,16 @@ export class PostingContentPartComponent implements OnInit {
private accountService: AccountService,
) {}

ngOnInit() {
ngOnInit(): void {
this.processContent();
}

ngOnChanges(changes: SimpleChanges): void {
if (changes.postingContentPart && !changes.postingContentPart.firstChange) {
this.processContent();
}
}

/**
* Opens an attachment with the given URL in a new window
*
Expand Down
Loading