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

@ -1 +1 @@
Subproject commit 2f510a798853ef3adfed7e8285c9d3f54eba493c
Subproject commit 43c0cbce452daff9bcc4c70866a56c8cbd548b4a

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();