From 06e5d19944362e42c5a1ed04fdd72496ec5a06dc Mon Sep 17 00:00:00 2001 From: m1k1o Date: Sun, 18 Oct 2020 17:19:23 +0200 Subject: [PATCH] fix build --- client/src/components/avatar.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/components/avatar.vue b/client/src/components/avatar.vue index bfa0170e..9116bfa6 100644 --- a/client/src/components/avatar.vue +++ b/client/src/components/avatar.vue @@ -7,7 +7,7 @@ height: size + 'px', lineHeight: size + 'px', fontSize: (size/2) + 'px', - backgroundColor: Background(), + backgroundColor: Background(seed), }"> {{ seed.substring(0, 2).toUpperCase() }} @@ -35,12 +35,12 @@ @Prop(String) readonly seed: string | undefined; @Prop(Number) readonly size: number | undefined; - Background() { + Background(seed: string) { let a = 0, b = 0, c = 0; - for(let i = 0; i < this.seed.length; i++) { - a += this.seed.charCodeAt(i) * 3; - b += this.seed.charCodeAt(i) * 5; - c += this.seed.charCodeAt(i) * 7; + for(let i = 0; i < seed.length; i++) { + a += seed.charCodeAt(i) * 3; + b += seed.charCodeAt(i) * 5; + c += seed.charCodeAt(i) * 7; } let x = Math.floor(128 + (a % 128));