From 4b1728e696413e410ed5c2f7b27836db0916e5ea Mon Sep 17 00:00:00 2001 From: ppoffice Date: Wed, 8 Jan 2020 01:14:58 -0500 Subject: [PATCH] fix(donate): rename donate to donates in config --- include/migration/v2_v3.js | 5 +++++ layout/common/donates.jsx | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/migration/v2_v3.js b/include/migration/v2_v3.js index 78b9550..c35f522 100644 --- a/include/migration/v2_v3.js +++ b/include/migration/v2_v3.js @@ -47,6 +47,11 @@ module.exports = class extends Migration { } } + if (Array.isArray(result.donate) && result.donate.length) { + result.donates = result.donate; + delete result.donate; + } + if (Array.isArray(result.widgets) && result.widgets.length) { for (const widget of result.widgets) { if (Object.prototype.hasOwnProperty.call(widget, 'type')) { diff --git a/layout/common/donates.jsx b/layout/common/donates.jsx index 91e944b..fe39f10 100644 --- a/layout/common/donates.jsx +++ b/layout/common/donates.jsx @@ -5,15 +5,15 @@ module.exports = class extends Component { render() { const { config, helper } = this.props; const { __ } = helper; - const { donate = [] } = config; - if (!Array.isArray(donate) || !donate.length) { + const { donates = [] } = config; + if (!Array.isArray(donates) || !donates.length) { return null; } return
- {donate.map(service => { + {donates.map(service => { const type = service.type; if (typeof type === 'string') { try {