로그인 후 마우스 뒤로가기 버튼 클릭시 로그인페이지로 가지 않도록 수정

This commit is contained in:
leejinho 2020-02-26 12:51:02 +09:00
parent 3aa1c4db8e
commit c0cecb0cf0

View File

@ -51,6 +51,7 @@ import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { LeftSideComponent } from '@app/layouts/messenger/components/left-side.component'; import { LeftSideComponent } from '@app/layouts/messenger/components/left-side.component';
import { MatDrawer } from '@angular/material/sidenav'; import { MatDrawer } from '@angular/material/sidenav';
import { LocationStrategy } from '@angular/common';
@Component({ @Component({
selector: 'app-page-messenger-main', selector: 'app-page-messenger-main',
@ -100,11 +101,18 @@ export class MainPageComponent implements OnInit, OnDestroy {
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private translateService: TranslateService, private translateService: TranslateService,
private dialogService: DialogService, private dialogService: DialogService,
private location: LocationStrategy,
private logger: NGXLogger private logger: NGXLogger
) { ) {
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>( this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
KEY_ENVIRONMENTS_INFO KEY_ENVIRONMENTS_INFO
); );
// preventing back button in browser
history.pushState(null, null, window.location.href);
this.location.onPopState(() => {
history.pushState(null, null, window.location.href);
});
} }
ngOnInit(): void { ngOnInit(): void {