|
|
|
@ -23,13 +23,14 @@ import { Store } from '@ngrx/store'; |
|
|
|
import { AppState } from '@core/core.state'; |
|
|
|
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; |
|
|
|
import { HasConfirmForm } from '@core/guards/confirm-on-exit.guard'; |
|
|
|
import { ActionAuthUpdateUserDetails } from '@core/auth/auth.actions'; |
|
|
|
import { ActionAuthUpdateAuthUser, ActionAuthUpdateUserDetails } from '@core/auth/auth.actions'; |
|
|
|
import { environment as env } from '@env/environment'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
import { ActionSettingsChangeLanguage } from '@core/settings/settings.actions'; |
|
|
|
import { ActivatedRoute } from '@angular/router'; |
|
|
|
import { isDefinedAndNotNull } from '@core/utils'; |
|
|
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
|
|
|
import { AuthService } from '@core/auth/auth.service'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-profile', |
|
|
|
@ -47,6 +48,7 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir |
|
|
|
constructor(protected store: Store<AppState>, |
|
|
|
private route: ActivatedRoute, |
|
|
|
private userService: UserService, |
|
|
|
private authService: AuthService, |
|
|
|
private translate: TranslateService, |
|
|
|
public fb: UntypedFormBuilder) { |
|
|
|
super(store); |
|
|
|
@ -93,7 +95,14 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir |
|
|
|
id: user.id, |
|
|
|
lastName: user.lastName, |
|
|
|
} })); |
|
|
|
this.store.dispatch(new ActionAuthUpdateAuthUser({ authUser: {...this.authUser, ...{ |
|
|
|
sub: user.email, |
|
|
|
phone: user.phone, |
|
|
|
firstName: user.firstName, |
|
|
|
lastName: user.lastName, |
|
|
|
}}})); |
|
|
|
this.store.dispatch(new ActionSettingsChangeLanguage({ userLang: user.additionalInfo.lang })); |
|
|
|
this.authService.refreshJwtToken(false); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|