アニメーション画像を無効にする際、サーバーサイドではなくクライアントサイドでURLを変更するように

This commit is contained in:
syuilo
2019-02-05 03:51:54 +09:00
parent f014b7ae0e
commit 861302f0fd
14 changed files with 40 additions and 56 deletions

View File

@ -17,6 +17,7 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import ImageViewer from './image-viewer.vue';
import { getStaticImageUrl } from '../../../common/scripts/get-static-image-url';
export default Vue.extend({
i18n: i18n('common/views/components/media-image.vue'),
@ -36,7 +37,11 @@ export default Vue.extend({
}
computed: {
style(): any {
let url = `url(${this.image.thumbnailUrl})`;
let url = `url(${
this.$store.state.device.doNotAutoplayAnimation
? getStaticImageUrl(this.image.thumbnailUrl)
: this.image.thumbnailUrl
})`;
if (this.$store.state.device.loadRemoteMedia || this.$store.state.device.lightmode) {
url = null;