]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Handle user saved and no longer has permissions
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 6 Mar 2023 18:04:18 +0000 (10:04 -0800)
committershamoon <4887959+shamoon@users.noreply.github.com>
Mon, 20 Mar 2023 06:39:52 +0000 (23:39 -0700)
src-ui/src/app/components/document-detail/document-detail.component.ts

index 0fc6174343c964e7a3468b575e5edfde8c797758..bb22c49ab3a868c77708c1940477b418bd8c5ddb 100644 (file)
@@ -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())
+            )
+          }
         },
       })
   }