aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
index ae6ac5387..387e9e7cd 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
@@ -1,6 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core' 2import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4 3
5@Component({ 4@Component({
6 selector: 'my-account-danger-zone', 5 selector: 'my-account-danger-zone',
@@ -15,23 +14,22 @@ export class MyAccountDangerZoneComponent {
15 private notifier: Notifier, 14 private notifier: Notifier,
16 private userService: UserService, 15 private userService: UserService,
17 private confirmService: ConfirmService, 16 private confirmService: ConfirmService,
18 private redirectService: RedirectService, 17 private redirectService: RedirectService
19 private i18n: I18n 18 ) { }
20 ) { }
21 19
22 async deleteMe () { 20 async deleteMe () {
23 const res = await this.confirmService.confirmWithInput( 21 const res = await this.confirmService.confirmWithInput(
24 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.'), 22 $localize`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.`,
25 this.i18n('Type your username to confirm'), 23 $localize`Type your username to confirm`,
26 this.user.username, 24 this.user.username,
27 this.i18n('Delete your account'), 25 $localize`Delete your account`,
28 this.i18n('Delete my account') 26 $localize`Delete my account`
29 ) 27 )
30 if (res === false) return 28 if (res === false) return
31 29
32 this.userService.deleteMe().subscribe( 30 this.userService.deleteMe().subscribe(
33 () => { 31 () => {
34 this.notifier.success(this.i18n('Your account is deleted.')) 32 this.notifier.success($localize`Your account is deleted.`)
35 33
36 this.authService.logout() 34 this.authService.logout()
37 this.redirectService.redirectToHomepage() 35 this.redirectService.redirectToHomepage()