mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-15 03:39:51 +00:00
fix generate from/add as chapter an empty selection
This commit is contained in:
parent
2b5ebdef92
commit
06027ea882
2 changed files with 9 additions and 0 deletions
|
@ -297,6 +297,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
}
|
||||
|
||||
if (tmpContent.trim() === '') {
|
||||
sendResponse('');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,14 @@ function sendMessage(tabId, action, justAddToBuffer) {
|
|||
chrome.tabs.sendMessage(tabId, {
|
||||
type: action
|
||||
}, function(response) {
|
||||
if (response.length === 0) {
|
||||
if (justAddToBuffer) {
|
||||
alert('Cannot add an empty selection as chapter!');
|
||||
} else {
|
||||
alert('Cannot generate the eBook from an empty selection!');
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
if (!justAddToBuffer) {
|
||||
buildEbook([response]);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue