sensitiveではないメディアも非表示にできるように (#6248)

* sensitiveではないメディアも非表示にできるように

* mounted -> created

* remove unnecessary v-if
This commit is contained in:
Satsuki Yanagi 2020-04-13 23:55:36 +09:00 committed by GitHub
parent dc9ea9ea70
commit ae5a8e776e
2 changed files with 15 additions and 7 deletions

View file

@ -1,12 +1,12 @@
<template> <template>
<div class="qjewsnkgzzxlxtzncydssfbgjibiehcy" v-if="image.isSensitive && hide && !$store.state.device.alwaysShowNsfw" @click="hide = false"> <div class="qjewsnkgzzxlxtzncydssfbgjibiehcy" v-if="hide" @click="hide = false">
<div> <div>
<b><fa :icon="faExclamationTriangle"/> {{ $t('sensitive') }}</b> <b><fa :icon="faExclamationTriangle"/> {{ $t('sensitive') }}</b>
<span>{{ $t('clickToShow') }}</span> <span>{{ $t('clickToShow') }}</span>
</div> </div>
</div> </div>
<div class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else> <div class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else>
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i> <i><fa :icon="faEyeSlash" @click="hide = true"/></i>
<a <a
:href="image.url" :href="image.url"
:style="style" :style="style"
@ -63,6 +63,9 @@ export default Vue.extend({
}; };
} }
}, },
created() {
this.hide = this.image.isSensitive && !this.$store.state.device.alwaysShowNsfw;
},
methods: { methods: {
onClick() { onClick() {
if (this.$store.state.device.imageNewTab) { if (this.$store.state.device.imageNewTab) {

View file

@ -1,12 +1,12 @@
<template> <template>
<div class="icozogqfvdetwohsdglrbswgrejoxbdj" v-if="video.isSensitive && hide && !$store.state.device.alwaysShowNsfw" @click="hide = false"> <div class="icozogqfvdetwohsdglrbswgrejoxbdj" v-if="hide" @click="hide = false">
<div> <div>
<b><fa icon="exclamation-triangle"/> {{ $t('sensitive') }}</b> <b><fa :icon="faExclamationTriangle"/> {{ $t('sensitive') }}</b>
<span>{{ $t('clickToShow') }}</span> <span>{{ $t('clickToShow') }}</span>
</div> </div>
</div> </div>
<div class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else> <div class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else>
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i> <i><fa :icon="faEyeSlash" @click="hide = true"/></i>
<a <a
:href="video.url" :href="video.url"
rel="nofollow noopener" rel="nofollow noopener"
@ -21,7 +21,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { faPlayCircle, faEyeSlash } from '@fortawesome/free-regular-svg-icons'; import { faPlayCircle } from '@fortawesome/free-regular-svg-icons';
import { faExclamationTriangle, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
import i18n from '../i18n'; import i18n from '../i18n';
export default Vue.extend({ export default Vue.extend({
@ -36,6 +37,7 @@ export default Vue.extend({
return { return {
hide: true, hide: true,
faPlayCircle, faPlayCircle,
faExclamationTriangle,
faEyeSlash faEyeSlash
}; };
}, },
@ -45,7 +47,10 @@ export default Vue.extend({
'background-image': `url(${this.video.thumbnailUrl})` 'background-image': `url(${this.video.thumbnailUrl})`
}; };
} }
} },
created() {
this.hide = this.video.isSensitive && !this.$store.state.device.alwaysShowNsfw;
},
}); });
</script> </script>