import { Component, Input } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { AuthService, ConfirmService, RedirectService } from '../../../core'
import { UserService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
constructor (
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private confirmService: ConfirmService,
private redirectService: RedirectService,
async deleteMe () {
const res = await this.confirmService.confirmWithInput(
- this.i18n('Are you sure you want to delete your account? This will delete all you data, including channels, videos etc.'),
+ this.i18n('Are you sure you want to delete your account? This will delete all your data, including channels, videos and comments. Content cached by other servers and other third-parties might make longer to be deleted.'),
this.i18n('Type your username to confirm'),
this.user.username,
this.i18n('Delete your account'),
this.userService.deleteMe().subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Your account is deleted.'))
+ this.notifier.success(this.i18n('Your account is deleted.'))
this.authService.logout()
this.redirectService.redirectToHomepage()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}