]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix change detection in app component
authorChocobozzz <me@florianbigard.com>
Tue, 22 May 2018 07:42:05 +0000 (09:42 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 22 May 2018 07:42:05 +0000 (09:42 +0200)
client/src/app/app.component.html
client/src/app/app.component.ts
client/src/app/core/auth/auth.service.ts
client/src/app/shared/misc/utils.ts
client/src/environments/environment.hmr.ts

index a7128d4fae2b5a1415567829d87ab01bb6da905a..e5054663396c99d4bac7ab35be48520ad5cda7e1 100644 (file)
@@ -22,7 +22,7 @@
         <my-menu></my-menu>
     </div>
 
-    <div class="main-col container-fluid" [ngClass]="getMainColClasses()">
+    <div class="main-col container-fluid" [ngClass]="{ expanded: isMenuDisplayed === false }">
 
       <div class="main-row">
         <router-outlet></router-outlet>
index 18115ae75db4ca9c38667753687ba93fb5a35e73..d5ba24e23503bde7861781118eb515b00cfe664a 100644 (file)
@@ -112,11 +112,4 @@ export class AppComponent implements OnInit {
     window.scrollTo(0, 0)
     this.isMenuDisplayed = !this.isMenuDisplayed
   }
-
-  getMainColClasses () {
-    // Take all width is the menu is not displayed
-    if (this.isMenuDisplayed === false) return [ 'expanded' ]
-
-    return []
-  }
 }
index 4213da20c065211f2468d23a4149d726dcb80be3..c3879d570afd5afa9995ef1aac2d419c385e6858 100644 (file)
@@ -122,7 +122,7 @@ export class AuthService {
       scope: 'upload',
       username,
       password
-  }
+    }
 
     const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
     return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers })
index 79c93c1b3539acb9d5b94a6d29e421b1656a4c41..727e339350d6717266a8a424451a488fa88a5d6e 100644 (file)
@@ -98,7 +98,7 @@ function lineFeedToHtml (obj: object, keyToNormalize: string) {
 
 // Try to cache a little bit window.innerWidth
 let windowInnerWidth = window.innerWidth
-setInterval(() => windowInnerWidth = window.innerWidth, 500)
+// setInterval(() => windowInnerWidth = window.innerWidth, 500)
 
 function isInSmallView () {
   return windowInnerWidth < 600
index 78cc8a992587b175a081f4701bcc702d7efb901e..20e2b8fcd1468d2978bd549e86b28e46e18a040a 100644 (file)
@@ -1,5 +1,5 @@
 export const environment = {
   production: false,
   hmr: true,
-  apiUrl: 'http://192.168.1.42:9000'
+  apiUrl: 'http://localhost:9000'
 }