Skip to content

Commit

Permalink
extension src bug
Browse files Browse the repository at this point in the history
  • Loading branch information
squidgetx committed Jan 26, 2023
1 parent 5504c19 commit b0212aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extension/src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const FETCH_ENDPOINT = CONFIG.serverEndpoint + "/fresh_tweets";
const LOG_ENDPOINT = CONFIG.serverEndpoint + "/log_tweets";

async function refresh_tweet_pool(username, install_code, ideo) {
console.log("Refreshing tweet pool..");
console.log("Refreshing tweet pool... " + FETCH_ENDPOINT);
const response = await fetch(FETCH_ENDPOINT, {
method: "POST",
body: JSON.stringify({
Expand Down Expand Up @@ -46,9 +46,11 @@ chrome.runtime.onMessage.addListener((message) => {
uploadLog(message.username, message.install_code, message.data).then(
(status) => {
tab_promise.then((tab) => {
chrome.tabs.sendMessage(tab[0].id, {
message: { name: "logEvent", status: status },
});
if (tab[0]) {
chrome.tabs.sendMessage(tab[0].id, {
message: { name: "logEvent", status: status },
});
}
});
}
);
Expand Down

0 comments on commit b0212aa

Please sign in to comment.