Fix: failed to find the old style when the name/namespace is changed (#581)
This commit is contained in:
parent
319ec320c7
commit
4120907957
|
@ -75,6 +75,7 @@
|
||||||
* @returns {Promise<{style, dup:Boolean?}>}
|
* @returns {Promise<{style, dup:Boolean?}>}
|
||||||
*/
|
*/
|
||||||
function build({
|
function build({
|
||||||
|
styleId,
|
||||||
sourceCode,
|
sourceCode,
|
||||||
checkDup,
|
checkDup,
|
||||||
metaOnly,
|
metaOnly,
|
||||||
|
@ -83,7 +84,8 @@
|
||||||
}) {
|
}) {
|
||||||
return usercss.buildMeta(sourceCode)
|
return usercss.buildMeta(sourceCode)
|
||||||
.then(style => {
|
.then(style => {
|
||||||
const findDup = checkDup || assignVars ? find(style) : null;
|
const findDup = checkDup || assignVars ?
|
||||||
|
find(styleId ? {id: styleId} : style) : Promise.resolve();
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
metaOnly ? style : doBuild(style, findDup),
|
metaOnly ? style : doBuild(style, findDup),
|
||||||
findDup
|
findDup
|
||||||
|
|
|
@ -82,6 +82,7 @@ function createSourceEditor(style) {
|
||||||
|
|
||||||
function preprocess(style) {
|
function preprocess(style) {
|
||||||
return API.buildUsercss({
|
return API.buildUsercss({
|
||||||
|
styleId: style.id,
|
||||||
sourceCode: style.sourceCode,
|
sourceCode: style.sourceCode,
|
||||||
assignVars: true
|
assignVars: true
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user