biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -2,37 +2,31 @@ import { mapGetters } from 'vuex'
|
|||
|
||||
const LinkPreview = {
|
||||
name: 'LinkPreview',
|
||||
props: [
|
||||
'card',
|
||||
'size',
|
||||
'nsfw'
|
||||
],
|
||||
data () {
|
||||
props: ['card', 'size', 'nsfw'],
|
||||
data() {
|
||||
return {
|
||||
imageLoaded: false
|
||||
imageLoaded: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
useImage () {
|
||||
useImage() {
|
||||
// Currently BE shoudn't give cards if tagged NSFW, this is a bit paranoid
|
||||
// as it makes sure to hide the image if somehow NSFW tagged preview can
|
||||
// exist.
|
||||
return this.card.image && !this.censored && this.size !== 'hide'
|
||||
},
|
||||
censored () {
|
||||
censored() {
|
||||
return this.nsfw && this.hideNsfwConfig
|
||||
},
|
||||
useDescription () {
|
||||
useDescription() {
|
||||
return this.card.description && /\S/.test(this.card.description)
|
||||
},
|
||||
hideNsfwConfig () {
|
||||
hideNsfwConfig() {
|
||||
return this.mergedConfig.hideNsfw
|
||||
},
|
||||
...mapGetters([
|
||||
'mergedConfig'
|
||||
])
|
||||
...mapGetters(['mergedConfig']),
|
||||
},
|
||||
created () {
|
||||
created() {
|
||||
if (this.useImage) {
|
||||
const newImg = new Image()
|
||||
newImg.onload = () => {
|
||||
|
|
@ -40,7 +34,7 @@ const LinkPreview = {
|
|||
}
|
||||
newImg.src = this.card.image
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default LinkPreview
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue