mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
allow reloading of current tab
This commit is contained in:
parent
aa0bfd3b45
commit
05684b3b03
@ -219,6 +219,7 @@ const routes: Routes = [
|
|||||||
component: CurrentTabComponent,
|
component: CurrentTabComponent,
|
||||||
canActivate: [AuthGuardService],
|
canActivate: [AuthGuardService],
|
||||||
data: { state: 'tabs_current' },
|
data: { state: 'tabs_current' },
|
||||||
|
runGuardsAndResolvers: 'always',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'vault',
|
path: 'vault',
|
||||||
@ -265,6 +266,7 @@ export class NoRouteReuseStrategy implements RouteReuseStrategy {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes, {
|
imports: [RouterModule.forRoot(routes, {
|
||||||
useHash: true,
|
useHash: true,
|
||||||
|
onSameUrlNavigation: 'reload',
|
||||||
/*enableTracing: true,*/
|
/*enableTracing: true,*/
|
||||||
})],
|
})],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
|
@ -8,9 +8,12 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
|
NavigationEnd,
|
||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
@ -61,6 +64,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
|
|||||||
private totpTimeout: number;
|
private totpTimeout: number;
|
||||||
private loadedTimeout: number;
|
private loadedTimeout: number;
|
||||||
private searchTimeout: number;
|
private searchTimeout: number;
|
||||||
|
private navSubscription: Subscription;
|
||||||
|
|
||||||
constructor(private platformUtilsService: PlatformUtilsService, private cipherService: CipherService,
|
constructor(private platformUtilsService: PlatformUtilsService, private cipherService: CipherService,
|
||||||
private popupUtilsService: PopupUtilsService, private autofillService: AutofillService,
|
private popupUtilsService: PopupUtilsService, private autofillService: AutofillService,
|
||||||
@ -68,25 +72,27 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
|
|||||||
private i18nService: I18nService, private router: Router,
|
private i18nService: I18nService, private router: Router,
|
||||||
private ngZone: NgZone, private broadcasterService: BroadcasterService,
|
private ngZone: NgZone, private broadcasterService: BroadcasterService,
|
||||||
private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService,
|
private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService,
|
||||||
private searchService: SearchService, private storageService: StorageService,
|
private searchService: SearchService, private storageService: StorageService) {
|
||||||
route: ActivatedRoute) {
|
this.navSubscription = this.router.events.subscribe(async (e: any) => {
|
||||||
route.params.subscribe((val) => {
|
// If it is a NavigationEnd event re-initialize the component
|
||||||
console.log('route.params.subscribe');
|
if (e instanceof NavigationEnd) {
|
||||||
if (platformUtilsService.getDevice() === DeviceType.SafariExtension) {
|
console.log('nav end');
|
||||||
console.log(val);
|
console.log(e);
|
||||||
this.init();
|
await this.init();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
console.log('ngOnInit');
|
console.log('ngOnInit');
|
||||||
await this.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
window.clearTimeout(this.loadedTimeout);
|
window.clearTimeout(this.loadedTimeout);
|
||||||
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||||
|
if (this.navSubscription != null) {
|
||||||
|
this.navSubscription.unsubscribe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
|
Loading…
Reference in New Issue
Block a user