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;
if (lastError) {
resolve({
status: 'error',
success: false,
error: lastError.message || String(lastError)
});
return;
}
resolve({status: 'success'});
resolve({success: true});
});
});
}

View File

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

View File

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