]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/users/user.service.ts
Don't display account setup modal on signup
[github/Chocobozzz/PeerTube.git] / client / src / app / core / users / user.service.ts
index a8a774eca5811a21caea01354b6ea19fc8a762af..be9e66c3c705f091371ab48375124b16c6f7d332 100644 (file)
@@ -1,6 +1,6 @@
 import { SortMeta } from 'primeng/api'
 import { from, Observable, of } from 'rxjs'
-import { catchError, concatMap, filter, first, map, shareReplay, throttleTime, toArray } from 'rxjs/operators'
+import { catchError, concatMap, filter, first, map, shareReplay, tap, throttleTime, toArray } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { AuthService } from '@app/core/auth'
@@ -28,6 +28,8 @@ export class UserService {
 
   private userCache: { [ id: number ]: Observable<UserServerModel> } = {}
 
+  private signupInThisSession = false
+
   constructor (
     private authHttp: HttpClient,
     private authService: AuthService,
@@ -37,6 +39,10 @@ export class UserService {
     private sessionStorageService: SessionStorageService
   ) { }
 
+  hasSignupInThisSession () {
+    return this.signupInThisSession
+  }
+
   changePassword (currentPassword: string, newPassword: string) {
     const url = UserService.BASE_USERS_URL + 'me'
     const body: UserUpdateMe = {
@@ -153,6 +159,7 @@ export class UserService {
     return this.authHttp.post(UserService.BASE_USERS_URL + 'register', userCreate)
                .pipe(
                  map(this.restExtractor.extractDataBool),
+                 tap(() => this.signupInThisSession = true),
                  catchError(err => this.restExtractor.handleError(err))
                )
   }