Fix race condition in color calculation.

This commit is contained in:
Roger Braun 2017-06-12 15:59:54 +02:00
parent fc341aa40d
commit 85cf036acd

View file

@ -61,11 +61,14 @@
props: [ 'user' ], props: [ 'user' ],
computed: { computed: {
headingStyle () { headingStyle () {
let color = this.$store.state.config.colors['base00']
if (color) {
let rgb = this.$store.state.config.colors['base00'].match(/\d+/g) let rgb = this.$store.state.config.colors['base00'].match(/\d+/g)
return { return {
backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, ${Math.floor(rgb[1] * 0.56)}, ${Math.floor(rgb[2] * 0.59)})`, backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, ${Math.floor(rgb[1] * 0.56)}, ${Math.floor(rgb[2] * 0.59)})`,
backgroundImage: `url(${this.user.cover_photo})` backgroundImage: `url(${this.user.cover_photo})`
} }
}
}, },
bodyStyle () { bodyStyle () {
return { return {