1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Pop out attachments page on Firefox and Safari

This commit is contained in:
Thomas Rittson
2021-01-13 18:27:23 +10:00
parent c4388dad66
commit 3844fdb959
4 changed files with 31 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
import { Location } from '@angular/common';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
@@ -18,7 +18,7 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
constructor(cipherService: CipherService, i18nService: I18nService,
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, private location: Location,
private route: ActivatedRoute) {
private route: ActivatedRoute, private router: Router) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, window);
}
@@ -33,6 +33,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
}
back() {
this.location.back();
if (document.referrer === "") {
this.router.navigate(['/edit-cipher'], { queryParams: { cipherId: this.cipher.id } });
} else {
this.location.back();
}
}
}