From b83188993fa9a62520faf05826202d3b124ae256 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 23 Oct 2018 16:17:30 -0400 Subject: [PATCH] go back to view after sharing --- jslib | 2 +- src/popup/app-routing.animations.ts | 2 +- src/popup/vault/share.component.ts | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index 2f510a79885..43c0cbce452 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2f510a798853ef3adfed7e8285c9d3f54eba493c +Subproject commit 43c0cbce452daff9bcc4c70866a56c8cbd548b4a diff --git a/src/popup/app-routing.animations.ts b/src/popup/app-routing.animations.ts index dea56a1819e..757b2fb0f77 100644 --- a/src/popup/app-routing.animations.ts +++ b/src/popup/app-routing.animations.ts @@ -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), diff --git a/src/popup/vault/share.component.ts b/src/popup/vault/share.component.ts index adb7af57327..f425b0cf8ab 100644 --- a/src/popup/vault/share.component.ts +++ b/src/popup/vault/share.component.ts @@ -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();