Skip to content

Commit

Permalink
enhance guard clause for social links check (#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslyl authored Jan 7, 2025
1 parent d51147f commit f46b83f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/experiments-realm/crm/contact.gts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export class SocialLinkField extends ContactLinkField {

class EmbeddedTemplate extends Component<typeof Contact> {
get hasSocialLinks() {
return (
this.args.model.socialLinks && this.args.model.socialLinks.length > 0
);
return Boolean(this.args.model?.socialLinks?.length);
}

<template>
Expand Down Expand Up @@ -120,9 +118,7 @@ class EmbeddedTemplate extends Component<typeof Contact> {

class FittedTemplate extends Component<typeof Contact> {
get hasSocialLinks() {
return (
this.args.model.socialLinks && this.args.model.socialLinks.length > 0
);
return Boolean(this.args.model?.socialLinks?.length);
}

<template>
Expand Down

0 comments on commit f46b83f

Please sign in to comment.