From 4cfc416cdcf3528f586f45d9d768bf3bfe8f9e1b Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:04:18 -0800 Subject: [PATCH] Handle user saved and no longer has permissions --- .../document-detail.component.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 0fc617434..bb22c49ab 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -474,12 +474,17 @@ export class DocumentDetailComponent }, error: (error) => { this.networkActive = false - this.error = error.error - this.toastService.showError( - $localize`Error saving document` + - ': ' + - (error.message ?? error.toString()) - ) + if (!this.userCanEdit) { + this.toastService.showInfo($localize`Document saved successfully.`) + this.close() + } else { + this.error = error.error + this.toastService.showError( + $localize`Error saving document` + + ': ' + + (error.message ?? error.toString()) + ) + } }, }) }