diff options
| author | Henry Jameson <me@hjkos.com> | 2021-03-08 22:01:28 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-03-08 22:01:28 +0200 |
| commit | 2e7bd99444546b3a71e1ff0753e12e6706c8228e (patch) | |
| tree | b01067c88bc969041d23392e7e34c976fae7b801 /src/components/timeline/timeline_quick_settings.js | |
| parent | 9a8bc245a6f76f1a41da9d05408dadc36625ffe9 (diff) | |
| parent | 6281241b92bc17a9535b15a52e656b9f218e3322 (diff) | |
Merge remote-tracking branch 'origin/develop' into websocket-fixes
* origin/develop: (119 commits)
Apply 1 suggestion(s) to 1 file(s)
Make it possible to localize user highlight options
remove shoutbox test hacks
fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack
update changelog with 2.3.0
change icons around
Translated using Weblate (Japanese)
Update timeline_quick_settings.js
add screen_name_ui to tests
separate screen_name and screen_name_ui with decoded punycode
Update CHANGELOG.md
add basic validation for statusless status notifications
changelog mention
fix chat unread badge
update shelljs to get rid of warnings on build
save a few characters
focus input in emoji picker and react picker
fix vue warnings
add only to wording
basic loggedin check for reply filtering
...
Diffstat (limited to 'src/components/timeline/timeline_quick_settings.js')
| -rw-r--r-- | src/components/timeline/timeline_quick_settings.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/components/timeline/timeline_quick_settings.js b/src/components/timeline/timeline_quick_settings.js new file mode 100644 index 00000000..9ec1a007 --- /dev/null +++ b/src/components/timeline/timeline_quick_settings.js @@ -0,0 +1,63 @@ +import Popover from '../popover/popover.vue' +import BooleanSetting from '../settings_modal/helpers/boolean_setting.vue' +import { mapGetters } from 'vuex' +import { library } from '@fortawesome/fontawesome-svg-core' +import { faFilter, faFont, faWrench } from '@fortawesome/free-solid-svg-icons' + +library.add( + faFilter, + faFont, + faWrench +) + +const TimelineQuickSettings = { + components: { + Popover, + BooleanSetting + }, + methods: { + setReplyVisibility (visibility) { + this.$store.dispatch('setOption', { name: 'replyVisibility', value: visibility }) + this.$store.dispatch('queueFlushAll') + }, + openTab (tab) { + this.$store.dispatch('openSettingsModalTab', tab) + } + }, + computed: { + ...mapGetters(['mergedConfig']), + loggedIn () { + return !!this.$store.state.users.currentUser + }, + replyVisibilitySelf: { + get () { return this.mergedConfig.replyVisibility === 'self' }, + set () { this.setReplyVisibility('self') } + }, + replyVisibilityFollowing: { + get () { return this.mergedConfig.replyVisibility === 'following' }, + set () { this.setReplyVisibility('following') } + }, + replyVisibilityAll: { + get () { return this.mergedConfig.replyVisibility === 'all' }, + set () { this.setReplyVisibility('all') } + }, + hideMedia: { + get () { return this.mergedConfig.hideAttachments || this.mergedConfig.hideAttachmentsInConv }, + set () { + const value = !this.hideMedia + this.$store.dispatch('setOption', { name: 'hideAttachments', value }) + this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) + } + }, + hideMutedPosts: { + get () { return this.mergedConfig.hideMutedPosts || this.mergedConfig.hideFilteredStatuses }, + set () { + const value = !this.hideMutedPosts + this.$store.dispatch('setOption', { name: 'hideMutedPosts', value }) + this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value }) + } + } + } +} + +export default TimelineQuickSettings |
