[Send] Updated delete function for add/edit component (#277)

* [Send] Updated delete function for add/edit component

* Saved final return statement
This commit is contained in:
Vincent Salucci 2021-02-19 10:23:51 -06:00 committed by GitHub
parent 5f5580cff9
commit 8a3b551c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -219,16 +219,16 @@ export class AddEditComponent implements OnInit {
} }
} }
async delete(): Promise<void> { async delete(): Promise<boolean> {
if (this.deletePromise != null) { if (this.deletePromise != null) {
return; return false;
} }
const confirmed = await this.platformUtilsService.showDialog( const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteSendConfirmation'), this.i18nService.t('deleteSendConfirmation'),
this.i18nService.t('deleteSend'), this.i18nService.t('deleteSend'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning'); this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
if (!confirmed) { if (!confirmed) {
return; return false;
} }
try { try {
@ -237,7 +237,10 @@ export class AddEditComponent implements OnInit {
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend')); this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend'));
await this.load(); await this.load();
this.onDeletedSend.emit(this.send); this.onDeletedSend.emit(this.send);
return true;
} catch { } } catch { }
return false;
} }
typeChanged() { typeChanged() {