diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 09:26:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 09:26:45 +0200 |
commit | bf80903fde923e0c84226ac442a2a382db74aee4 (patch) | |
tree | eec79c6dc03c131695aa73a7b3eed3a8cb6bbc6c /client/src/app/core/users | |
parent | e111a5a3a11a5b251b8989cd406c2dbba9254e28 (diff) | |
download | PeerTube-bf80903fde923e0c84226ac442a2a382db74aee4.tar.gz PeerTube-bf80903fde923e0c84226ac442a2a382db74aee4.tar.zst PeerTube-bf80903fde923e0c84226ac442a2a382db74aee4.zip |
Don't display account setup modal on signup
Don't bother user with a modal just after signup
Diffstat (limited to 'client/src/app/core/users')
-rw-r--r-- | client/src/app/core/users/user.service.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/core/users/user.service.ts b/client/src/app/core/users/user.service.ts index a8a774eca..be9e66c3c 100644 --- a/client/src/app/core/users/user.service.ts +++ b/client/src/app/core/users/user.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { from, Observable, of } from 'rxjs' | 2 | import { from, Observable, of } from 'rxjs' |
3 | import { catchError, concatMap, filter, first, map, shareReplay, throttleTime, toArray } from 'rxjs/operators' | 3 | import { catchError, concatMap, filter, first, map, shareReplay, tap, throttleTime, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { AuthService } from '@app/core/auth' | 6 | import { AuthService } from '@app/core/auth' |
@@ -28,6 +28,8 @@ export class UserService { | |||
28 | 28 | ||
29 | private userCache: { [ id: number ]: Observable<UserServerModel> } = {} | 29 | private userCache: { [ id: number ]: Observable<UserServerModel> } = {} |
30 | 30 | ||
31 | private signupInThisSession = false | ||
32 | |||
31 | constructor ( | 33 | constructor ( |
32 | private authHttp: HttpClient, | 34 | private authHttp: HttpClient, |
33 | private authService: AuthService, | 35 | private authService: AuthService, |
@@ -37,6 +39,10 @@ export class UserService { | |||
37 | private sessionStorageService: SessionStorageService | 39 | private sessionStorageService: SessionStorageService |
38 | ) { } | 40 | ) { } |
39 | 41 | ||
42 | hasSignupInThisSession () { | ||
43 | return this.signupInThisSession | ||
44 | } | ||
45 | |||
40 | changePassword (currentPassword: string, newPassword: string) { | 46 | changePassword (currentPassword: string, newPassword: string) { |
41 | const url = UserService.BASE_USERS_URL + 'me' | 47 | const url = UserService.BASE_USERS_URL + 'me' |
42 | const body: UserUpdateMe = { | 48 | const body: UserUpdateMe = { |
@@ -153,6 +159,7 @@ export class UserService { | |||
153 | return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate) | 159 | return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate) |
154 | .pipe( | 160 | .pipe( |
155 | map(this.restExtractor.extractDataBool), | 161 | map(this.restExtractor.extractDataBool), |
162 | tap(() => this.signupInThisSession = true), | ||
156 | catchError(err => this.restExtractor.handleError(err)) | 163 | catchError(err => this.restExtractor.handleError(err)) |
157 | ) | 164 | ) |
158 | } | 165 | } |