Skip to content

Commit

Permalink
send empty responses and remove async; its not helping
Browse files Browse the repository at this point in the history
  • Loading branch information
makaveli10 committed Oct 18, 2023
1 parent 1938dfb commit a2b5220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Audio-Transcription-Chrome/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (type === "STOP") {
remove_element();
sendResponse({data: "STOPPED"});
return;
return true;
} else if (type === "showWaitPopup"){
initPopupElement();

showPopup(`Estimated wait time ~ ${Math.round(data)} minutes`);
sendResponse({data: "popup"});
return;
return true;
}

init_element();
Expand Down Expand Up @@ -234,4 +234,5 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
}

sendResponse({});
return true;
});
5 changes: 3 additions & 2 deletions Audio-Transcription-Chrome/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,17 @@ async function startRecord(option) {
* @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.
*/
chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
const { type, data } = request;

switch (type) {
case "start_capture":
await startRecord(data);
startRecord(data);
break;
default:
break;
}

sendResponse({});
return true;
});

0 comments on commit a2b5220

Please sign in to comment.