Skip to content

Commit

Permalink
linter and minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
thepiwo authored and AtanasKrondev committed Jun 17, 2021
1 parent 1c22290 commit 492d701
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
3 changes: 1 addition & 2 deletions src/components/tipRecords/TipPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ export default {
return this.isPreviewToBeVisualized && this.tip.LinkPreview.image !== null ? Backend.getTipPreviewUrl(this.tip.LinkPreview.image) : '';
},
isPreviewToBeVisualized() {
return this.tip.LinkPreview
&& (this.tip.LinkPreview.description || this.tip.LinkPreview.title);
return this.tip.LinkPreview?.description || this.tip.LinkPreview?.title;
},
richPreviewComponent() {
return [{
Expand Down
22 changes: 1 addition & 21 deletions src/views/TipsAndComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import Loading from '../components/Loading.vue';
import backendAuthMixin from '../utils/backendAuthMixin';
import SendComment from '../components/SendComment.vue';
import { EventBus } from '../utils/eventBus';
import Backend from '../utils/backend';
export default {
components: {
Expand Down Expand Up @@ -130,26 +129,7 @@ export default {
tip: 'Comments for a Tip',
comment: 'Comment View',
}[this.$route.name];
const author = this.id ? this.record?.author : this.record?.sender;
const avatar = Backend.getProfileImageUrl(author);
const ogImage = this.record?.media?.length ? this.record.media[0] : avatar;
const ogUrl = window.location.href.split('?')[0];
const ogTitle = `Superhero ${this.id ? 'Comment' : `Tip ${this.tipId.split('_')[1]}`}`;
const ogDescription = this.id ? this.record?.text : this.record?.title;
const meta = [
{ property: 'og:image', content: ogImage },
{ property: 'og:url', content: ogUrl },
{ property: 'og:title', content: ogTitle },
{ property: 'og:description', content: ogDescription },
{ property: 'og:site_name', content: 'Superhero' },
{ name: 'twitter:card', content: 'summary' },
{ name: 'twitter:site', content: '@superhero_chain' },
{ name: 'twitter:creator', content: '@superhero_chain' },
{ name: 'twitter:image:alt', content: 'Superhero post' },
];
return { title, meta };
return { title };
},
};
</script>
Expand Down

0 comments on commit 492d701

Please sign in to comment.