mirror of
https://github.com/bitwarden/web
synced 2025-12-14 15:23:14 +00:00
go back to previous url after lock
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 3362334d2c...2b575f0c60
@@ -36,9 +36,12 @@ export class LockComponent extends BaseLockComponent {
|
||||
this.router.navigate(['vault']);
|
||||
}
|
||||
|
||||
const previousUrl = this.routerService.getPreviousUrl();
|
||||
if (previousUrl !== '/' && previousUrl.indexOf('lock') === -1) {
|
||||
this.successRoute = previousUrl;
|
||||
}
|
||||
this.onSuccessfulSubmit = () => {
|
||||
const previousUrl = this.routerService.getPreviousUrl();
|
||||
if (previousUrl !== '/' && previousUrl.indexOf('lock') === -1) {
|
||||
this.successRoute = previousUrl;
|
||||
}
|
||||
this.router.navigate([this.successRoute]);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,9 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
this.notificationsService.updateConnection(false);
|
||||
this.router.navigate(['lock']);
|
||||
break;
|
||||
case 'lockedUrl':
|
||||
window.setTimeout(() => this.routerService.setPreviousUrl(message.url), 500);
|
||||
break;
|
||||
case 'syncStarted':
|
||||
break;
|
||||
case 'syncCompleted':
|
||||
|
||||
@@ -14,7 +14,7 @@ export class RouterService {
|
||||
private currentUrl: string = undefined;
|
||||
|
||||
constructor(private router: Router, private activatedRoute: ActivatedRoute,
|
||||
private titleService: Title, private i18nService: I18nService) {
|
||||
private titleService: Title, i18nService: I18nService) {
|
||||
this.currentUrl = this.router.url;
|
||||
router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
@@ -55,4 +55,8 @@ export class RouterService {
|
||||
getPreviousUrl() {
|
||||
return this.previousUrl;
|
||||
}
|
||||
|
||||
setPreviousUrl(url: string) {
|
||||
this.previousUrl = url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user