From 4eb50d757d03343ee842ea68a6b2c8282ef3f382 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 27 Apr 2021 07:30:47 +1000 Subject: [PATCH] Let subclasses override create Send success msg (#362) --- src/angular/components/send/add-edit.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/angular/components/send/add-edit.component.ts b/src/angular/components/send/add-edit.component.ts index 0bdf0a918ac..4ba73fb2a1f 100644 --- a/src/angular/components/send/add-edit.component.ts +++ b/src/angular/components/send/add-edit.component.ts @@ -302,6 +302,8 @@ export class AddEditComponent implements OnInit { const encSend = await this.encryptSend(file); try { this.formPromise = this.sendService.saveWithServer(encSend); + let inactive = false; + setTimeout(() => inactive = true, 4500); await this.formPromise; if (this.send.id == null) { this.send.id = encSend[0].id; @@ -309,9 +311,8 @@ export class AddEditComponent implements OnInit { if (this.send.accessId == null) { this.send.accessId = encSend[0].accessId; } - this.platformUtilsService.showToast('success', null, - this.i18nService.t(this.editMode ? 'editedSend' : 'createdSend')); this.onSavedSend.emit(this.send); + await this.showSuccessMessage(inactive); if (this.copyLink) { this.copyLinkToClipboard(this.link); } @@ -321,6 +322,11 @@ export class AddEditComponent implements OnInit { return false; } + async showSuccessMessage(inactive: boolean) { + this.platformUtilsService.showToast('success', null, + this.i18nService.t(this.editMode ? 'editedSend' : 'createdSend')); + } + clearExpiration() { this.expirationDate = null; this.expirationDateFallback = null;