Fix: reindent single then

This commit is contained in:
eight 2017-11-09 05:52:59 +08:00
parent 8d19e0b09a
commit 92b01e19e8
2 changed files with 13 additions and 15 deletions

View File

@ -50,17 +50,16 @@ var usercssHelper = (() => {
if (style.reason === 'config' && style.id) { if (style.reason === 'config' && style.id) {
return style; return style;
} }
return findDup(style) return findDup(style).then(dup => {
.then(dup => { if (dup) {
if (dup) { style.id = dup.id;
style.id = dup.id; if (style.reason !== 'config') {
if (style.reason !== 'config') { // preserve style.vars during update
// preserve style.vars during update usercss.assignVars(style, dup);
usercss.assignVars(style, dup);
}
} }
return style; }
}); return style;
});
} }
} }

View File

@ -16,11 +16,10 @@ function createSourceLoader() {
} }
function load() { function load() {
return fetchText(location.href) return fetchText(location.href).then(newSource => {
.then(newSource => { source = newSource;
source = newSource; return source;
return source; });
});
} }
function watch(cb) { function watch(cb) {