Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettify toaster message, and refresh token without asking for logout #18976

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading