aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_card_content/user_card_content.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/user_card_content/user_card_content.vue')
-rw-r--r--src/components/user_card_content/user_card_content.vue17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue
index 8c971d53..ff1b108c 100644
--- a/src/components/user_card_content/user_card_content.vue
+++ b/src/components/user_card_content/user_card_content.vue
@@ -61,10 +61,13 @@
props: [ 'user' ],
computed: {
headingStyle () {
- let rgb = this.$store.state.config.colors['base00'].match(/\d+/g)
- return {
- 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})`
+ let color = this.$store.state.config.colors['base00']
+ if (color) {
+ let rgb = this.$store.state.config.colors['base00'].match(/\d+/g)
+ return {
+ 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})`
+ }
}
},
bodyStyle () {
@@ -79,9 +82,8 @@
return this.$store.state.users.currentUser
},
dailyAvg () {
- return Math.round(
- this.user.statuses_count / ((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000))
- )
+ const days = Math.ceil((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000))
+ return Math.round(this.user.statuses_count / days)
}
},
methods: {
@@ -117,7 +119,6 @@
}
.profile-panel-body {
- padding-top: 0em;
top: -0em;
padding-top: 4em;
}