import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { ScreenService } from '@app/shared/misc/screen.service'
import { UserHistoryService } from '@app/shared/users/user-history.service'
import { UserService } from '@app/shared'
+import { Notifier, ServerService } from '@app/core'
@Component({
selector: 'my-account-history',
})
export class MyAccountHistoryComponent extends AbstractVideoList implements OnInit, OnDestroy {
titlePage: string
- currentRoute = '/my-account/history/videos'
pagination: ComponentPagination = {
currentPage: 1,
itemsPerPage: 5,
}
videosHistoryEnabled: boolean
- protected baseVideoWidth = -1
- protected baseVideoHeight = 155
-
constructor (
+ protected i18n: I18n,
protected router: Router,
+ protected serverService: ServerService,
protected route: ActivatedRoute,
protected authService: AuthService,
protected userService: UserService,
- protected notificationsService: NotificationsService,
- protected location: Location,
+ protected notifier: Notifier,
protected screenService: ScreenService,
- protected i18n: I18n,
private confirmService: ConfirmService,
private videoService: VideoService,
private userHistoryService: UserHistoryService
this.i18n('Videos history is enabled') :
this.i18n('Videos history is disabled')
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.authService.refreshUserInformation()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.userHistoryService.deleteUserVideosHistory()
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Videos history deleted'))
+ this.notifier.success(this.i18n('Videos history deleted'))
this.reloadVideos()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}