Skip to content
Snippets Groups Projects
Commit 7c0f3ea6 authored by lain's avatar lain
Browse files

Add setting to hide all attachments.

parent 0e1ab69c
No related branches found
No related tags found
No related merge requests found
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 })
}
}
}
......
......@@ -8,6 +8,11 @@
<h2>Theme</h2>
<style-switcher></style-switcher>
</div>
<div class="setting-item">
<h2>Attachments</h2>
<input type="checkbox" id="hideAttachments" v-model="hideAttachmentsLocal">
<label for="hideAttachments">Hide Attachments</label>
</div>
</div>
</div>
</template>
......
......@@ -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 () {
......
......@@ -57,7 +57,7 @@
<div @click.prevent="linkClicked" class="status-content" v-html="status.statusnet_html"></div>
<div v-if='status.attachments' class='attachments'>
<attachment :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments">
<attachment v-if="!hideAttachments" :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments">
</attachment>
</div>
</div>
......
......@@ -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({
......
......@@ -3,7 +3,8 @@ import StyleSetter from '../services/style_setter/style_setter.js'
const defaultState = {
name: 'Pleroma FE',
colors: {}
colors: {},
hideAttachments: false
}
const config = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment