1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

control applying saved state and when to show groupings

This commit is contained in:
Kyle Spearrin
2018-10-29 09:29:21 -04:00
parent 0cdc343ce0
commit bc5cec82cc
3 changed files with 52 additions and 38 deletions

View File

@@ -59,7 +59,6 @@ export class AppComponent implements OnInit {
});
private lastActivity: number = null;
private previousUrl: string = '';
constructor(private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics, private analytics: Angulartics2,
private toasterService: ToasterService, private storageService: StorageService,
@@ -124,14 +123,15 @@ export class AppComponent implements OnInit {
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
const url = event.urlAfterRedirects || event.url || '';
if (url.startsWith('/tabs/') && this.previousUrl.startsWith('/tabs/')) {
if (url.startsWith('/tabs/') && (window as any).previousPopupUrl != null &&
(window as any).previousPopupUrl.startsWith('/tabs/')) {
this.stateService.remove('GroupingsComponent');
this.stateService.remove('CiphersComponent');
}
if (url.startsWith('/tabs/')) {
this.stateService.remove('addEditCipher');
}
this.previousUrl = url;
(window as any).previousPopupUrl = url;
// Clear route direction after animation (400ms)
if ((window as any).routeDirection != null) {