send empty responses and remove async; its not helping
This commit is contained in:
@@ -173,13 +173,13 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
if (type === "STOP") {
|
if (type === "STOP") {
|
||||||
remove_element();
|
remove_element();
|
||||||
sendResponse({data: "STOPPED"});
|
sendResponse({data: "STOPPED"});
|
||||||
return;
|
return true;
|
||||||
} else if (type === "showWaitPopup"){
|
} else if (type === "showWaitPopup"){
|
||||||
initPopupElement();
|
initPopupElement();
|
||||||
|
|
||||||
showPopup(`Estimated wait time ~ ${Math.round(data)} minutes`);
|
showPopup(`Estimated wait time ~ ${Math.round(data)} minutes`);
|
||||||
sendResponse({data: "popup"});
|
sendResponse({data: "popup"});
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_element();
|
init_element();
|
||||||
@@ -234,4 +234,5 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendResponse({});
|
sendResponse({});
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -184,16 +184,17 @@ async function startRecord(option) {
|
|||||||
* @param {Object} sender - The sender object containing information about the message sender.
|
* @param {Object} sender - The sender object containing information about the message sender.
|
||||||
* @param {Function} sendResponse - The function to send a response back to the message sender.
|
* @param {Function} sendResponse - The function to send a response back to the message sender.
|
||||||
*/
|
*/
|
||||||
chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
|
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||||
const { type, data } = request;
|
const { type, data } = request;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "start_capture":
|
case "start_capture":
|
||||||
await startRecord(data);
|
startRecord(data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendResponse({});
|
sendResponse({});
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user