Make defaulting to pleroma-dark work when config.json has an invalid theme. Remove logging.

This commit is contained in:
shpuld 2017-11-18 13:27:37 +02:00
parent d65d6e5da4
commit 3534a9a62f
2 changed files with 1 additions and 5 deletions

View file

@ -15,7 +15,6 @@ export default {
window.fetch('/static/styles.json') window.fetch('/static/styles.json')
.then((data) => data.json()) .then((data) => data.json())
.then((themes) => { .then((themes) => {
console.log(themes)
self.availableStyles = themes self.availableStyles = themes
}) })
}, },
@ -29,8 +28,6 @@ export default {
} }
this.bgColorLocal = rgbstr2hex(this.$store.state.config.colors['base00']) this.bgColorLocal = rgbstr2hex(this.$store.state.config.colors['base00'])
this.fgColorLocal = rgbstr2hex(this.$store.state.config.colors['base02']) this.fgColorLocal = rgbstr2hex(this.$store.state.config.colors['base02'])
console.log(this.$store.state.config.colors['base02'])
console.log(this.fgColorLocal)
this.textColorLocal = rgbstr2hex(this.$store.state.config.colors['base05']) this.textColorLocal = rgbstr2hex(this.$store.state.config.colors['base05'])
this.linkColorLocal = rgbstr2hex(this.$store.state.config.colors['base08']) this.linkColorLocal = rgbstr2hex(this.$store.state.config.colors['base08'])
}, },
@ -52,7 +49,6 @@ export default {
const textRgb = rgb(this.textColorLocal) const textRgb = rgb(this.textColorLocal)
const linkRgb = rgb(this.linkColorLocal) const linkRgb = rgb(this.linkColorLocal)
if (bgRgb && fgRgb && linkRgb) { if (bgRgb && fgRgb && linkRgb) {
console.log('all colors ok')
this.$store.dispatch('setOption', { this.$store.dispatch('setOption', {
name: 'customTheme', name: 'customTheme',
value: { value: {

View file

@ -121,7 +121,7 @@ const setPreset = (val, commit) => {
window.fetch('/static/styles.json') window.fetch('/static/styles.json')
.then((data) => data.json()) .then((data) => data.json())
.then((themes) => { .then((themes) => {
const theme = themes[val] ? themes[val] : themes[0] const theme = themes[val] ? themes[val] : themes['pleroma-dark']
const bgRgb = hex2rgb(theme[1]) const bgRgb = hex2rgb(theme[1])
const fgRgb = hex2rgb(theme[2]) const fgRgb = hex2rgb(theme[2])
const textRgb = hex2rgb(theme[3]) const textRgb = hex2rgb(theme[3])