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 storage from 'electron-json-storage'
|
||||||
import objectAssignDeep from 'object-assign-deep'
|
import objectAssignDeep from 'object-assign-deep'
|
||||||
import Visibility from '../constants/visibility'
|
|
||||||
import DisplayStyle from '../constants/displayStyle'
|
import DisplayStyle from '../constants/displayStyle'
|
||||||
import Theme from '../constants/theme'
|
import Theme from '../constants/theme'
|
||||||
import Language from '../constants/language'
|
import Language from '../constants/language'
|
||||||
|
@ -13,8 +12,7 @@ const Base = {
|
||||||
sound: {
|
sound: {
|
||||||
fav_rb: true,
|
fav_rb: true,
|
||||||
toot: true
|
toot: true
|
||||||
},
|
}
|
||||||
tootVisibility: Visibility.Public.value
|
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
collapse: false,
|
collapse: false,
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="general" v-loading="loading">
|
<div id="general" v-loading="loading">
|
||||||
<h2>{{ $t('preferences.general.title') }}</h2>
|
<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">
|
<div class="sounds section">
|
||||||
<h3>{{ $t('preferences.general.sounds.title') }}</h3>
|
<h3>{{ $t('preferences.general.sounds.title') }}</h3>
|
||||||
<p class="description">{{ $t('preferences.general.sounds.description') }}</p>
|
<p class="description">{{ $t('preferences.general.sounds.description') }}</p>
|
||||||
|
@ -40,31 +28,13 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import Visibility from '~/src/constants/visibility'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'general',
|
name: 'general',
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
visibilities: [
|
|
||||||
Visibility.Public,
|
|
||||||
Visibility.Unlisted,
|
|
||||||
Visibility.Private
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
loading: state => state.Preferences.General.loading
|
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: {
|
sound_fav_rb: {
|
||||||
get () {
|
get () {
|
||||||
return this.$store.state.Preferences.General.general.sound.fav_rb
|
return this.$store.state.Preferences.General.general.sound.fav_rb
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { ipcRenderer } from 'electron'
|
import { ipcRenderer } from 'electron'
|
||||||
import Visibility from '~/src/constants/visibility'
|
|
||||||
|
|
||||||
const General = {
|
const General = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
|
@ -8,8 +7,7 @@ const General = {
|
||||||
sound: {
|
sound: {
|
||||||
fav_rb: true,
|
fav_rb: true,
|
||||||
toot: true
|
toot: true
|
||||||
},
|
}
|
||||||
tootVisibility: Visibility.Public.value
|
|
||||||
},
|
},
|
||||||
loading: false
|
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) {
|
updateSound ({ commit, state }, sound) {
|
||||||
commit('changeLoading', true)
|
commit('changeLoading', true)
|
||||||
const newSound = Object.assign({}, state.general.sound, sound)
|
const newSound = Object.assign({}, state.general.sound, sound)
|
||||||
|
|
Loading…
Reference in New Issue