Skip to content

Commit 5ea9b8d

Browse files
fix file verification
1 parent ed69d33 commit 5ea9b8d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/app/GN2CommonModule/form/dynamic-form-generator/dynamic-form-generator.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ export class GenericFormGeneratorComponent implements OnInit, OnChanges {
134134
* on teste s'il y a un changement entre this.myFormGroup.value et valueSaved;
135135
*/
136136
hasValueChanged(newValue) {
137+
// Deep equals doesn't work with File type
138+
for (let key in newValue) {
139+
if (newValue[key] instanceof File) if (newValue[key] !== this.oldValue[key]) return true;
140+
}
137141
return !equal(newValue, this.oldValue);
138142
}
139143

0 commit comments

Comments
 (0)