dev #14305 Изменение дизайна WPA Кофе-лайка: fix infinity loading when login (typescript error)

This commit is contained in:
nikolay 2023-05-23 12:36:10 +04:00
parent 238b70e95b
commit 7bade7caea

View File

@ -45,7 +45,8 @@ export class WpJsonService {
getCustomerInfo(systemId: string, token: string, url: string): Observable<any> { getCustomerInfo(systemId: string, token: string, url: string): Observable<any> {
return this._request(`customer_info/${systemId}/${token}/`, 'GET', null, false, url).pipe( return this._request(`customer_info/${systemId}/${token}/`, 'GET', null, false, url).pipe(
switchMap((response) => { switchMap((response) => {
if (response?.customer_info?.errorCode !== 'Customer_CustomerNotFound') { // TODO: typescript compile optional chaining ('response?.customer_info?.errorCode') without check ('response.customer_info.errorCode')
if (response && response.customer_info && response.customer_info.errorCode !== 'Customer_CustomerNotFound') {
return of(response) return of(response)
} else { } else {
return this.newCustomer(systemId, token, url).pipe( return this.newCustomer(systemId, token, url).pipe(