|
|
@@ -35,15 +35,15 @@ export class ContentItem {
|
|
|
this.price = Number(props.price);
|
|
|
this.priceFormatted = this.formatCents(this.price);
|
|
|
}
|
|
|
- this.allLinks = props.links;
|
|
|
- this.userLinks = props.links.filter(x => !x.rel.startsWith('.'));
|
|
|
- this.systemLinks = props.links.filter(x => x.rel.startsWith('.'));
|
|
|
+ this.allLinks = props.links || [];
|
|
|
+ this.userLinks = this.allLinks.filter(x => !x.rel.startsWith('.'));
|
|
|
+ this.systemLinks = this.allLinks.filter(x => x.rel.startsWith('.'));
|
|
|
|
|
|
- this.fromTarget = props.links.filter(x => x.rel === '.from').map(x => x.target)[0];
|
|
|
- this.toTarget = props.links.filter(x => x.rel === '.to').map(x => x.target)[0];
|
|
|
- this.fromContactId = props.links.filter(x => x.rel === '.from-contact-id').map(x => x.target)[0];
|
|
|
- this.toContactId = props.links.filter(x => x.rel === '.to-contact-id').map(x => x.target)[0];
|
|
|
- this.media = props.links.filter(x => x.rel === '.media').map(x => x.target)[0];
|
|
|
+ this.fromTarget = this.allLinks.filter(x => x.rel === '.from').map(x => x.target)[0];
|
|
|
+ this.toTarget = this.allLinks.filter(x => x.rel === '.to').map(x => x.target)[0];
|
|
|
+ this.fromContactId = this.allLinks.filter(x => x.rel === '.from-contact-id').map(x => x.target)[0];
|
|
|
+ this.toContactId = this.allLinks.filter(x => x.rel === '.to-contact-id').map(x => x.target)[0];
|
|
|
+ this.media = this.allLinks.filter(x => x.rel === '.media').map(x => x.target)[0];
|
|
|
if (this.fromTarget && this.toTarget && this.media) {
|
|
|
this.repliable = true;
|
|
|
} else {
|