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

use router links instead of back

This commit is contained in:
Kyle Spearrin
2018-04-13 13:18:43 -04:00
parent 0505043e18
commit 40790790b2
8 changed files with 15 additions and 34 deletions

View File

@@ -1,4 +1,3 @@
import { Location } from '@angular/common';
import { Component } from '@angular/core';
import {
ActivatedRoute,
@@ -23,8 +22,8 @@ import {
export class FolderAddEditComponent extends BaseFolderAddEditComponent {
constructor(folderService: FolderService, i18nService: I18nService,
analytics: Angulartics2, toasterService: ToasterService,
platformUtilsService: PlatformUtilsService, private location: Location,
private router: Router, private route: ActivatedRoute) {
platformUtilsService: PlatformUtilsService, private router: Router,
private route: ActivatedRoute) {
super(folderService, i18nService, analytics, toasterService, platformUtilsService);
}
@@ -39,21 +38,17 @@ export class FolderAddEditComponent extends BaseFolderAddEditComponent {
async submit(): Promise<boolean> {
if (await super.submit()) {
this.location.back();
this.router.navigate(['/folders']);
return true;
}
return false;
}
cancel() {
this.location.back();
}
async delete(): Promise<boolean> {
const confirmed = await super.delete();
if (confirmed) {
this.location.back();
this.router.navigate(['/folders']);
}
return confirmed;
}