]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix doc detail button reset on error
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 31 Mar 2023 20:47:35 +0000 (13:47 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Fri, 31 Mar 2023 20:47:35 +0000 (13:47 -0700)
src-ui/src/app/components/document-detail/document-detail.component.html
src-ui/src/app/components/document-detail/document-detail.component.ts

index 3cd4c9a17e39b9399f6b74c9a782aaaa0ffc353d..828f19c5f0d3e82bd1ec5ad8570207a534dfb62f 100644 (file)
 
             <ng-container>
                 <button type="button" class="btn btn-outline-secondary" (click)="discard()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Discard</button>&nbsp;
-                <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true || error">Save & next</button>&nbsp;
-                <button type="submit" class="btn btn-primary" *appIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true || error">Save</button>&nbsp;
+                <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save & next</button>&nbsp;
+                <button type="submit" class="btn btn-primary" *appIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save</button>&nbsp;
             </ng-container>
         </form>
     </div>
index bb22c49ab3a868c77708c1940477b418bd8c5ddb..9c5efe8f629719d5d4df7f869ff5bf9470413b2e 100644 (file)
@@ -462,12 +462,13 @@ export class DocumentDetailComponent
 
   save() {
     this.networkActive = true
-    this.store.next(this.documentForm.value)
     this.documentsService
       .update(this.document)
       .pipe(first())
       .subscribe({
         next: () => {
+          this.store.next(this.documentForm.value)
+          this.toastService.showInfo($localize`Document saved successfully.`)
           this.close()
           this.networkActive = false
           this.error = null