community.component.ts: Moved "loading twitter widget script conditionally" part inside communityInformationState.subscribe and added check if communityInfo not null/undefined.
This commit is contained in:
parent
4fd401297c
commit
d5eba5c095
|
@ -226,6 +226,16 @@ export class CommunityComponent {
|
||||||
this.subs.push(this.config.communityInformationState.subscribe(
|
this.subs.push(this.config.communityInformationState.subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.communityInfo = res;
|
this.communityInfo = res;
|
||||||
|
|
||||||
|
// loading twitter widget script conditionally
|
||||||
|
if (properties.environment == "development") {
|
||||||
|
if (this.communityInfo && this.communityInfo.twitterAccount) {
|
||||||
|
let script = this._renderer2.createElement('script');
|
||||||
|
script.charset = "utf-8";
|
||||||
|
script.src = "https://platform.twitter.com/widgets.js";
|
||||||
|
this._renderer2.appendChild(this._document.body, script);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
//console.log(error)
|
//console.log(error)
|
||||||
|
@ -233,15 +243,6 @@ export class CommunityComponent {
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
// loading twitter widget script conditionally
|
|
||||||
if(properties.environment == "development") {
|
|
||||||
if(this.communityInfo.twitterAccount) {
|
|
||||||
let script = this._renderer2.createElement('script');
|
|
||||||
script.charset = "utf-8";
|
|
||||||
script.src = "https://platform.twitter.com/widgets.js";
|
|
||||||
this._renderer2.appendChild(this._document.body, script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchPublications(page: number, size: number) {
|
private searchPublications(page: number, size: number) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0aa44646b1c57974569aadcaa4ba67a8a5028ef4
|
Subproject commit fcf29d801ff0c580f55de4328e1198307cee3166
|
Loading…
Reference in New Issue