mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Fix doc detail button reset on error
This commit is contained in:
		| @@ -192,8 +192,8 @@ | ||||
|  | ||||
|             <ng-container> | ||||
|                 <button type="button" class="btn btn-outline-secondary" (click)="discard()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Discard</button>  | ||||
|                 <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true || error">Save & next</button>  | ||||
|                 <button type="submit" class="btn btn-primary" *appIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true || error">Save</button>  | ||||
|                 <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save & next</button>  | ||||
|                 <button type="submit" class="btn btn-primary" *appIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save</button>  | ||||
|             </ng-container> | ||||
|         </form> | ||||
|     </div> | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon