]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
Reorganize client shared modules
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / account-video-channels / account-video-channels.component.ts
index 5572064c1c95c9e96cde71311cecd5c569c4b704..205245675af0d19b483b809df2969f93fa4a23e9 100644 (file)
@@ -1,17 +1,9 @@
-import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ActivatedRoute } from '@angular/router'
-import { Account } from '@app/shared/account/account.model'
-import { AccountService } from '@app/shared/account/account.service'
-import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
-import { concatMap, map, switchMap, tap } from 'rxjs/operators'
 import { from, Subject, Subscription } from 'rxjs'
-import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
-import { Video } from '@app/shared/video/video.model'
-import { AuthService } from '@app/core'
-import { VideoService } from '@app/shared/video/video.service'
-import { VideoSortField } from '@app/shared/video/sort-field.type'
-import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
-import { ScreenService } from '@app/shared/misc/screen.service'
+import { concatMap, map, switchMap, tap } from 'rxjs/operators'
+import { Component, OnDestroy, OnInit } from '@angular/core'
+import { ComponentPagination, hasMoreItems, ScreenService, User, UserService } from '@app/core'
+import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
+import { VideoSortField } from '@shared/models'
 
 @Component({
   selector: 'my-account-video-channels',
@@ -38,21 +30,18 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
 
   onChannelDataSubject = new Subject<any>()
 
+  userMiniature: User
+
   private accountSub: Subscription
 
   constructor (
-    private route: ActivatedRoute,
-    private authService: AuthService,
     private accountService: AccountService,
     private videoChannelService: VideoChannelService,
     private videoService: VideoService,
-    private screenService: ScreenService
+    private screenService: ScreenService,
+    private userService: UserService
   ) { }
 
-  get user () {
-    return this.authService.getUser()
-  }
-
   ngOnInit () {
     // Parent get the account for us
     this.accountSub = this.accountService.accountLoaded
@@ -61,6 +50,9 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
 
           this.loadMoreChannels()
         })
+
+    this.userService.getAnonymousOrLoggedUser()
+      .subscribe(user => this.userMiniature = user)
   }
 
   ngOnDestroy () {