mirror of
https://github.com/bpatrik/pigallery2.git
synced 2026-06-20 00:15:49 +02:00
Fix object navigation error
This commit is contained in:
+8
-5
@@ -98,11 +98,13 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
|
||||
executeAction(): void {
|
||||
if (this.modalData && this.isFormValid()) {
|
||||
// save value to reuse in the next modal
|
||||
this.modalData.button.popup.customFields.forEach(field => {
|
||||
if (field.keepValue) {
|
||||
this.modalService.setValue(field.id, this.formData.customFields[field.id]);
|
||||
}
|
||||
});
|
||||
if (this.modalData?.button?.popup?.customFields) {
|
||||
this.modalData.button.popup.customFields.forEach(field => {
|
||||
if (field.keepValue) {
|
||||
this.modalService.setValue(field.id, this.formData.customFields[field.id]);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.modalService.executeButtonAction(
|
||||
this.modalData.button,
|
||||
this.modalData.media,
|
||||
@@ -152,6 +154,7 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
|
||||
if (this.modalData?.button?.popup?.customFields) {
|
||||
this.formData.customFields = {};
|
||||
this.modalData.button.popup.customFields.forEach(field => {
|
||||
// load last value if we should keep it
|
||||
if (field.keepValue && this.modalService.getValue(field.id) !== undefined) {
|
||||
this.formData.customFields[field.id] = this.modalService.getValue(field.id);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user