1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

send created redirect

This commit is contained in:
jaasen-livefront
2024-09-17 16:30:58 -07:00
parent a151f40e3b
commit 36711d54a3
5 changed files with 33 additions and 15 deletions

View File

@@ -89,7 +89,9 @@ export class SendAddEditComponent {
* Handles the event when the send is saved.
*/
onSendSaved() {
this.location.back();
if (this.config.mode !== "add") {
this.location.back();
}
}
/**

View File

@@ -1,6 +1,11 @@
<main class="tw-top-0">
<popup-page>
<popup-header slot="header" [pageTitle]="'createdSend' | i18n" showBackButton>
<popup-header
slot="header"
[pageTitle]="'createdSend' | i18n"
showBackButton
[backAction]="close.bind(this)"
>
<ng-container slot="end">
<app-pop-out></app-pop-out>
</ng-container>

View File

@@ -1,7 +1,7 @@
import { CommonModule, Location } from "@angular/common";
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
import { ActivatedRoute, RouterLink } from "@angular/router";
import { ActivatedRoute, Router, RouterLink, RouterModule } from "@angular/router";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
@@ -30,6 +30,7 @@ import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page
PopupHeaderComponent,
PopupPageComponent,
RouterLink,
RouterModule,
PopupFooterComponent,
IconModule,
],
@@ -45,10 +46,11 @@ export class SendCreatedComponent {
private sendService: SendService,
private route: ActivatedRoute,
private toastService: ToastService,
private location: Location,
private router: Router,
private environmentService: EnvironmentService,
) {
const sendId = this.route.snapshot.queryParamMap.get("sendId");
this.sendService.sendViews$.pipe(takeUntilDestroyed()).subscribe((sendViews) => {
this.send = sendViews.find((s) => s.id === sendId);
if (this.send) {
@@ -62,8 +64,8 @@ export class SendCreatedComponent {
return Math.max(0, Math.ceil((send.deletionDate.getTime() - now) / (1000 * 60 * 60 * 24)));
}
close() {
this.location.back();
async close() {
await this.router.navigate(["/tabs/send"]);
}
async copyLink() {