Add: make filterUsercss build code to get section includes
This commit is contained in:
parent
78264a1c34
commit
f74641e20d
|
@ -274,11 +274,17 @@ function filterUsercss(req) {
|
|||
if (!style.id && req.id) {
|
||||
style.id = req.id;
|
||||
}
|
||||
if (!style.id && req.checkDup) {
|
||||
return findDupUsercss(style)
|
||||
.then(dup => ({status: 'success', style, dup}));
|
||||
let pending;
|
||||
if (!style.sections || !style.sections.length) {
|
||||
pending = usercss.buildCode(style);
|
||||
} else {
|
||||
pending = Promise.resolve(style);
|
||||
}
|
||||
return {status: 'success', style};
|
||||
if (!style.id && req.checkDup) {
|
||||
return Promise.all([pending, findDupUsercss(style)])
|
||||
.then(([, dup]) => ({status: 'success', style, dup}));
|
||||
}
|
||||
return pending.then(() => ({status: 'success', style}));
|
||||
}).catch(err => ({status: 'error', error: String(err)}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user