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) {
|
if (!style.id && req.id) {
|
||||||
style.id = req.id;
|
style.id = req.id;
|
||||||
}
|
}
|
||||||
if (!style.id && req.checkDup) {
|
let pending;
|
||||||
return findDupUsercss(style)
|
if (!style.sections || !style.sections.length) {
|
||||||
.then(dup => ({status: 'success', style, dup}));
|
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)}));
|
}).catch(err => ({status: 'error', error: String(err)}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user