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:
+3
@@ -98,11 +98,13 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
|
|||||||
executeAction(): void {
|
executeAction(): void {
|
||||||
if (this.modalData && this.isFormValid()) {
|
if (this.modalData && this.isFormValid()) {
|
||||||
// save value to reuse in the next modal
|
// save value to reuse in the next modal
|
||||||
|
if (this.modalData?.button?.popup?.customFields) {
|
||||||
this.modalData.button.popup.customFields.forEach(field => {
|
this.modalData.button.popup.customFields.forEach(field => {
|
||||||
if (field.keepValue) {
|
if (field.keepValue) {
|
||||||
this.modalService.setValue(field.id, this.formData.customFields[field.id]);
|
this.modalService.setValue(field.id, this.formData.customFields[field.id]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.modalService.executeButtonAction(
|
this.modalService.executeButtonAction(
|
||||||
this.modalData.button,
|
this.modalData.button,
|
||||||
this.modalData.media,
|
this.modalData.media,
|
||||||
@@ -152,6 +154,7 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
|
|||||||
if (this.modalData?.button?.popup?.customFields) {
|
if (this.modalData?.button?.popup?.customFields) {
|
||||||
this.formData.customFields = {};
|
this.formData.customFields = {};
|
||||||
this.modalData.button.popup.customFields.forEach(field => {
|
this.modalData.button.popup.customFields.forEach(field => {
|
||||||
|
// load last value if we should keep it
|
||||||
if (field.keepValue && this.modalService.getValue(field.id) !== undefined) {
|
if (field.keepValue && this.modalService.getValue(field.id) !== undefined) {
|
||||||
this.formData.customFields[field.id] = this.modalService.getValue(field.id);
|
this.formData.customFields[field.id] = this.modalService.getValue(field.id);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user