Added the NSFW alert to the link preview.
This commit is contained in:
parent
cd784396e7
commit
45180d4069
4 changed files with 29 additions and 11 deletions
|
@ -1,3 +1,5 @@
|
|||
import { mapGetters } from 'vuex'
|
||||
|
||||
const LinkPreview = {
|
||||
name: 'LinkPreview',
|
||||
props: [
|
||||
|
@ -15,11 +17,20 @@ const LinkPreview = {
|
|||
// 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.nsfw && this.size !== 'hide'
|
||||
return this.card.image && !this.censored && this.size !== 'hide'
|
||||
},
|
||||
censored () {
|
||||
return this.nsfw && this.hideNsfwConfig
|
||||
},
|
||||
useDescription () {
|
||||
return this.card.description && /\S/.test(this.card.description)
|
||||
}
|
||||
},
|
||||
hideNsfwConfig () {
|
||||
return this.mergedConfig.hideNsfw
|
||||
},
|
||||
...mapGetters([
|
||||
'mergedConfig'
|
||||
])
|
||||
},
|
||||
created () {
|
||||
if (this.useImage) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue