From e8b64d11a3c33628e04f277918c98738db816e16 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 16 Oct 2018 22:04:29 +0800 Subject: [PATCH] Fix: drop array selection --- background/update.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/background/update.js b/background/update.js index 9daad4b5..7f5b60ce 100644 --- a/background/update.js +++ b/background/update.js @@ -88,9 +88,18 @@ 'ignoreDigest' option is set on the second manual individual update check on the manage page. */ return fetchStyle() - .then([calcStyleDigest][!ignoreDigest ? 0 : 'skip']) - .then([checkIfEdited][!ignoreDigest ? 0 : 'skip']) - .then([maybeUpdateUSO, maybeUpdateUsercss][style.usercssData ? 1 : 0]) + .then(() => { + if (!ignoreDigest) { + return calcStyleDigest(style) + .then(checkIfEdited); + } + }) + .then(() => { + if (style.usercssData) { + return maybeUpdateUsercss(); + } + return maybeUpdateUSO(); + }) .then(maybeSave) .then(reportSuccess) .catch(reportFailure); @@ -100,8 +109,8 @@ return Promise.resolve(); } return styleManager.get(id) - .then(_style => { - style = _style; + .then(style_ => { + style = style_; }); }