diff --git a/js/src/admin/components/MailPage.js b/js/src/admin/components/MailPage.js index 442e513d5..6a7b41e62 100644 --- a/js/src/admin/components/MailPage.js +++ b/js/src/admin/components/MailPage.js @@ -29,12 +29,13 @@ export default class MailPage extends Page { {} ); - Object.keys(this.driverFields).flatMap(key => this.driverFields[key]).forEach( - key => { - this.fields.push(key); - this.values[key] = m.prop(settings[key]); + for (const driver in this.driverFields) { + for (const field in this.driverFields[driver]) { + this.fields.push(field); + this.values[field] = m.prop(settings[field]); } - ); + } + this.loading = false; m.redraw(); }); @@ -87,9 +88,9 @@ export default class MailPage extends Page { className: 'MailPage-MailSettings', children: [
- {this.driverFields[this.values.mail_driver()].flatMap(field => [ + {Object.keys(this.driverFields[this.values.mail_driver()]).map(field => [ , - + this.renderField(field), ])}
] @@ -108,6 +109,18 @@ export default class MailPage extends Page { ); } + renderField(name) { + const driver = this.values.mail_driver(); + const field = this.driverFields[driver][name]; + const prop = this.values[name]; + + if (typeof field === 'string') { + return ; + } else { + return