Browse Source

Fix user profile banner bugs

Carsten Porth 5 years ago
parent
commit
7a440c4b75

+ 1 - 1
app/src/components/profile-header/profile-header.html

@@ -1,6 +1,6 @@
 <!-- Generated template for the ProfileHeaderComponent component -->
 <div>
-  <div class="profile-banner" [style.background-image]="'url('+ user.profile_banner_url +')'">
+  <div class="profile-banner" [style.background-image]="'url('+ banner +')'">
     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px"
       viewBox="0 0 300 100" xml:space="preserve" width="100%" class="svg-triangle">
       <polygon points="0,75  0,100 300,100 300,99" fill="#FFFFFF" />

+ 8 - 0
app/src/components/profile-header/profile-header.ts

@@ -15,4 +15,12 @@ export class ProfileHeaderComponent {
   user: any;
 
   constructor() {}
+
+  get banner() {
+    if (this.user.profile_banner_url) {
+      return this.user.profile_banner_url;
+    } else {
+      return this.user.profile_background_image_url_https;
+    }
+  }
 }