From 26384544571e0ebb0eb8c0fce702f51dde03cade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinan=20=C3=96zt=C3=BCrk?= Date: Thu, 8 Feb 2024 18:42:26 +0300 Subject: [PATCH] prettify toaster message, and refresh token without asking for logout --- .../personal-settings/personal-settings.component.ts | 10 +++++++++- .../src/lib/components/toast/toast.component.scss | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts index a40041551a..94c96e1e80 100644 --- a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts @@ -5,7 +5,7 @@ import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { finalize, filter } from 'rxjs/operators'; import { Account } from '../../models/account'; import { ManageProfileStateService } from '../../services/manage-profile.state.service'; -import { AuthService } from '@abp/ng.core'; +import { AuthService, ConfigStateService } from '@abp/ng.core'; import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens'; import { EXTENSIONS_IDENTIFIER, @@ -44,6 +44,7 @@ export class PersonalSettingsComponent private manageProfileState: ManageProfileStateService, private readonly authService: AuthService, private confirmationService: ConfirmationService, + private configState: ConfigStateService, @Inject(RE_LOGIN_CONFIRMATION_TOKEN) private isPersonalSettingsChangedConfirmationActive: boolean, protected injector: Injector, @@ -65,13 +66,20 @@ export class PersonalSettingsComponent submit() { if (this.form.invalid) return; const isLogOutConfirmMessageVisible = this.isLogoutConfirmMessageActive(); + const isRefreshTokenExists = this.authService.getRefreshToken(); this.inProgress = true; this.profileService .update(this.form.value) .pipe(finalize(() => (this.inProgress = false))) .subscribe(profile => { this.manageProfileState.setProfile(profile); + this.configState.refreshAppState(); this.toasterService.success('AbpAccount::PersonalSettingsSaved', 'Success', { life: 5000 }); + + if(isRefreshTokenExists){ + return this.authService.refreshToken(); + } + if (isLogOutConfirmMessageVisible) { this.showLogoutConfirmMessage(); } diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.scss b/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.scss index 192af4afdb..b4966c310d 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.scss +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.scss @@ -49,6 +49,7 @@ $toastClass: abp-toast; position: relative; display: flex; align-self: center; + flex-direction: column; word-break: break-word; .#{$toastClass}-close-button { position: absolute;