From 7c0f3ea666a866a3bb1f2e8da161ae69901e519b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 23 Feb 2017 00:04:47 +0100 Subject: [PATCH] Add setting to hide all attachments. --- src/components/settings/settings.js | 10 ++++++++++ src/components/settings/settings.vue | 5 +++++ src/components/status/status.js | 1 + src/components/status/status.vue | 2 +- src/main.js | 2 +- src/modules/config.js | 3 ++- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index f979e7ab24..61236af2b5 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,8 +1,18 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue' const settings = { + data () { + return { + hideAttachmentsLocal: this.$store.state.config.hideAttachments + } + }, components: { StyleSwitcher + }, + watch: { + hideAttachmentsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideAttachments', value }) + } } } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 57aafac8cd..f2f83953ea 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -8,6 +8,11 @@

Theme

+
+

Attachments

+ + +
diff --git a/src/components/status/status.js b/src/components/status/status.js index 46add8aa0e..22292ffaf7 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -17,6 +17,7 @@ const Status = { userExpanded: false }), computed: { + hideAttachments () { return this.$store.state.config.hideAttachments }, retweet () { return !!this.statusoid.retweeted_status }, retweeter () { return this.statusoid.user.name }, status () { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index b0f468e51a..1e970ec64b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -57,7 +57,7 @@
- +
diff --git a/src/main.js b/src/main.js index 22879b34cb..51d281fa19 100644 --- a/src/main.js +++ b/src/main.js @@ -29,7 +29,7 @@ Vue.use(VueTimeago, { }) const persistedStateOptions = { - paths: ['users.users', 'statuses.notifications'] + paths: ['users.users', 'statuses.notifications', 'config.hideAttachments'] } const store = new Vuex.Store({ diff --git a/src/modules/config.js b/src/modules/config.js index 30155f45c8..25de98ea80 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -3,7 +3,8 @@ import StyleSetter from '../services/style_setter/style_setter.js' const defaultState = { name: 'Pleroma FE', - colors: {} + colors: {}, + hideAttachments: false } const config = {