reload returns promise

This commit is contained in:
Edi Cziszter 2021-12-15 12:37:02 +02:00
parent 9a478d960a
commit e312f40a84
2 changed files with 3 additions and 4 deletions

View File

@ -68,8 +68,8 @@ export class UserPreferenceService extends GenericService<UserAttributes> {
window.location.reload();
}
reload(): void {
this.getAll<UserAttributes>()
reload(): Promise<void> {
return this.getAll<UserAttributes>()
.toPromise()
.then(attributes => {
this._userAttributes = attributes ?? {};

View File

@ -23,8 +23,7 @@ export function configurationInitializer(
switchMap(loggedIn => (!loggedIn ? throwError('Not Logged In') : of({}))),
mergeMapTo(generalSettingsService.getGeneralConfigurations()),
tap(configuration => configService.updateDisplayName(configuration.displayName)),
tap(() => userPreferenceService.reload()),
tap(() => languageService.chooseAndSetInitialLanguage()),
tap(() => userPreferenceService.reload().then(() => languageService.chooseAndSetInitialLanguage())),
catchError(() => {
title.setTitle('RedactManager');
return of({});