From 8d19e0b09a6e095e9fc4364ac8e48b769d8ed905 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 9 Nov 2017 05:51:58 +0800 Subject: [PATCH] Fix: noReject in one line --- background/usercss-helper.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/background/usercss-helper.js b/background/usercss-helper.js index f2d7521d..804e7c80 100644 --- a/background/usercss-helper.js +++ b/background/usercss-helper.js @@ -35,10 +35,7 @@ var usercssHelper = (() => { ])) .then(([style, dup]) => ({style, dup})); - if (noReject) { - return wrapReject(pending); - } - return pending; + return noReject ? wrapReject(pending) : pending; } function save(style, noReject) { @@ -47,11 +44,7 @@ var usercssHelper = (() => { .then(buildCode) .then(saveStyle); - if (noReject) { - return wrapReject(pending); - } - - return pending; + return noReject ? wrapReject(pending) : pending; function assignVars(style) { if (style.reason === 'config' && style.id) {