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'
private userCache: { [ id: number ]: Observable<UserServerModel> } = {}
+ private signupInThisSession = false
+
constructor (
private authHttp: HttpClient,
private authService: AuthService,
private restService: RestService,
private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService
- ) { }
+ ) { }
+
+ hasSignupInThisSession () {
+ return this.signupInThisSession
+ }
changePassword (currentPassword: string, newPassword: string) {
const url = UserService.BASE_USERS_URL + 'me'
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))
)
}
getUserWithCache (userId: number) {
if (!this.userCache[userId]) {
- this.userCache[ userId ] = this.getUser(userId).pipe(shareReplay())
+ this.userCache[userId] = this.getUser(userId).pipe(shareReplay())
}
return this.userCache[userId]
const filters = this.restService.parseQueryStringFilter(search, {
blocked: {
prefix: 'banned:',
- isBoolean: true,
- handler: v => {
- if (v === 'true') return v
- if (v === 'false') return v
-
- return undefined
- }
+ isBoolean: true
}
})