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

go back to view after sharing

This commit is contained in:
Kyle Spearrin
2018-10-23 16:17:30 -04:00
parent fd80d4557f
commit b83188993f
3 changed files with 10 additions and 4 deletions

2
jslib

Submodule jslib updated: 2f510a7988...43c0cbce45

View File

@@ -121,7 +121,7 @@ export const routerTransition = trigger('routerTransition', [
transition('generator => add-cipher, generator => edit-cipher', outSlideDown),
transition('edit-cipher => share-cipher', inSlideUp),
transition('share-cipher => edit-cipher', outSlideDown),
transition('share-cipher => edit-cipher, share-cipher => view-cipher', outSlideDown),
transition('edit-cipher => attachments, edit-cipher => collections', inSlideLeft),
transition('attachments => edit-cipher, collections => edit-cipher', outSlideRight),

View File

@@ -1,6 +1,9 @@
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 { CollectionService } from 'jslib/abstractions/collection.service';
@@ -18,11 +21,14 @@ export class ShareComponent extends BaseShareComponent {
constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, userService: UserService,
cipherService: CipherService, private route: ActivatedRoute,
private location: Location) {
private location: Location, private router: Router) {
super(collectionService, platformUtilsService, i18nService, userService, cipherService);
}
async ngOnInit() {
this.onSharedCipher.subscribe(() => {
this.router.navigate(['view-cipher', { cipherId: this.cipherId }]);
});
this.route.queryParams.subscribe(async (params) => {
this.cipherId = params.cipherId;
await super.ngOnInit();