From 29abded6da10546c76d06490743c67b2adfd2f05 Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Fri, 9 Jun 2023 17:48:14 -0400 Subject: [PATCH] Add error handling to save function --- web/app/components/document/sidebar.ts | 33 ++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/web/app/components/document/sidebar.ts b/web/app/components/document/sidebar.ts index 4a3aaacdd..721f1ab72 100644 --- a/web/app/components/document/sidebar.ts +++ b/web/app/components/document/sidebar.ts @@ -216,16 +216,20 @@ export default class DocumentSidebarComponent extends Component { - this.product = product; - await this.save.perform("product", this.product); - // productAbbreviation is computed by the back end - } - ); + updateProduct = restartableTask(async (product: string) => { + this.product = product; + await this.save.perform("product", this.product); + // productAbbreviation is computed by the back end + }); save = task(async (field: string, val: string | HermesUser[]) => { if (field && val) { @@ -261,7 +263,8 @@ export default class DocumentSidebarComponent extends Component