Fix: status: 'success' -> success: true

This commit is contained in:
eight 2017-11-09 05:35:45 +08:00
parent 391cfb52dd
commit 90be1dae25
3 changed files with 5 additions and 5 deletions

View File

@ -346,12 +346,12 @@ function closeTab(tabId, request) {
const {lastError} = chrome.runtime; const {lastError} = chrome.runtime;
if (lastError) { if (lastError) {
resolve({ resolve({
status: 'error', success: false,
error: lastError.message || String(lastError) error: lastError.message || String(lastError)
}); });
return; return;
} }
resolve({status: 'success'}); resolve({success: true});
}); });
}); });
} }

View File

@ -22,8 +22,8 @@ var usercssHelper = (() => {
} }
function wrapReject(pending) { function wrapReject(pending) {
return pending.then(result => ({status: 'success', result})) return pending.then(result => ({success: true, result}))
.catch(err => ({status: 'error', result: err.message || String(err)})); .catch(err => ({success: false, result: err.message || String(err)}));
} }
// Parse the source and find the duplication // Parse the source and find the duplication

View File

@ -4,7 +4,7 @@ function runtimeSend(request) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
chrome.runtime.sendMessage( chrome.runtime.sendMessage(
request, request,
({status, result}) => (status === 'error' ? reject : resolve)(result) ({success, result}) => (success ? resolve : reject)(result)
); );
}); });
} }