init plugin hooks before resetting widgets, the areas are returned by
`filter:widgets.getAreas`
This commit is contained in:
Barış Soner Uşaklı
2017-07-12 20:10:19 -04:00
parent 4056283fd5
commit 5888a5ffc4
2 changed files with 9 additions and 6 deletions

View File

@@ -10,7 +10,6 @@ var events = require('./events');
var Reset = {};
Reset.reset = function (callback) {
db.init(function (err) {
if (err) {
@@ -163,10 +162,14 @@ function resetPlugins(callback) {
}
function resetWidgets(callback) {
require('./widgets').reset(function (err) {
async.waterfall([
require('./plugins').reload,
require('./widgets').reset,
function (next) {
winston.info('[reset] All Widgets moved to Draft Zone');
callback(err);
});
next();
},
], callback);
}
module.exports = Reset;

View File

@@ -193,7 +193,7 @@ widgets.reset = function (callback) {
function (results, next) {
drafts = results.drafts || [];
async.each(results.areas, function (area, next) {
async.eachSeries(results.areas, function (area, next) {
async.waterfall([
function (next) {
widgets.getArea(area.template, area.location, next);