refs #673 Remove old visibility settings
This commit is contained in:
parent
1690b0b55b
commit
30a68ab57d
|
@ -1,6 +1,5 @@
|
|||
import storage from 'electron-json-storage'
|
||||
import objectAssignDeep from 'object-assign-deep'
|
||||
import Visibility from '../constants/visibility'
|
||||
import DisplayStyle from '../constants/displayStyle'
|
||||
import Theme from '../constants/theme'
|
||||
import Language from '../constants/language'
|
||||
|
@ -13,8 +12,7 @@ const Base = {
|
|||
sound: {
|
||||
fav_rb: true,
|
||||
toot: true
|
||||
},
|
||||
tootVisibility: Visibility.Public.value
|
||||
}
|
||||
},
|
||||
state: {
|
||||
collapse: false,
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
<template>
|
||||
<div id="general" v-loading="loading">
|
||||
<h2>{{ $t('preferences.general.title') }}</h2>
|
||||
<div class="toot section">
|
||||
<h3>{{ $t('preferences.general.toot.title') }}</h3>
|
||||
<p class="description">{{ $t('preferences.general.toot.description') }}</p>
|
||||
<el-select v-model="tootVisibility" placeholder="visibility">
|
||||
<el-option
|
||||
v-for="v in visibilities"
|
||||
:key="v.value"
|
||||
:label="$t(v.name)"
|
||||
:value="v.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="sounds section">
|
||||
<h3>{{ $t('preferences.general.sounds.title') }}</h3>
|
||||
<p class="description">{{ $t('preferences.general.sounds.description') }}</p>
|
||||
|
@ -40,31 +28,13 @@
|
|||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Visibility from '~/src/constants/visibility'
|
||||
|
||||
export default {
|
||||
name: 'general',
|
||||
data () {
|
||||
return {
|
||||
visibilities: [
|
||||
Visibility.Public,
|
||||
Visibility.Unlisted,
|
||||
Visibility.Private
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loading: state => state.Preferences.General.loading
|
||||
}),
|
||||
tootVisibility: {
|
||||
get () {
|
||||
return this.$store.state.Preferences.General.general.tootVisibility
|
||||
},
|
||||
set (value) {
|
||||
this.$store.dispatch('Preferences/General/updateTootVisibility', value)
|
||||
}
|
||||
},
|
||||
sound_fav_rb: {
|
||||
get () {
|
||||
return this.$store.state.Preferences.General.general.sound.fav_rb
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { ipcRenderer } from 'electron'
|
||||
import Visibility from '~/src/constants/visibility'
|
||||
|
||||
const General = {
|
||||
namespaced: true,
|
||||
|
@ -8,8 +7,7 @@ const General = {
|
|||
sound: {
|
||||
fav_rb: true,
|
||||
toot: true
|
||||
},
|
||||
tootVisibility: Visibility.Public.value
|
||||
}
|
||||
},
|
||||
loading: false
|
||||
},
|
||||
|
@ -39,23 +37,6 @@ const General = {
|
|||
})
|
||||
})
|
||||
},
|
||||
updateTootVisibility ({ dispatch, commit, state }, value) {
|
||||
const newGeneral = Object.assign({}, state.general, {
|
||||
tootVisibility: value
|
||||
})
|
||||
const config = {
|
||||
general: newGeneral
|
||||
}
|
||||
ipcRenderer.send('update-preferences', config)
|
||||
ipcRenderer.once('error-update-preferences', (event, err) => {
|
||||
ipcRenderer.removeAllListeners('response-update-preferences')
|
||||
})
|
||||
ipcRenderer.once('response-update-preferences', (event, conf) => {
|
||||
ipcRenderer.removeAllListeners('error-update-preferences')
|
||||
dispatch('App/loadPreferences', null, { root: true })
|
||||
commit('updateGeneral', conf.general)
|
||||
})
|
||||
},
|
||||
updateSound ({ commit, state }, sound) {
|
||||
commit('changeLoading', true)
|
||||
const newSound = Object.assign({}, state.general.sound, sound)
|
||||
|
|
Loading…
Reference in New Issue