Skip to content

Commit

Permalink
restore pinging
Browse files Browse the repository at this point in the history
  • Loading branch information
ynshung committed Oct 27, 2023
1 parent ea38de6 commit 7d7fe1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/chromeEmitters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// import BROWSER from "../background/browser";
import BROWSER from "../background/browser";
import { ChangedObjectStateEnum } from "./definitions";

/**
Expand All @@ -12,16 +12,16 @@ export function pingChanges(
message: object,
) {
(async () => {
// const [tab] = await BROWSER.tabs.query({
// active: true,
// lastFocusedWindow: true,
// });
const [tab] = await BROWSER.tabs.query({
active: true,
lastFocusedWindow: true,
});
const key = ChangedObjectStateEnum[objectEnum].toLowerCase() ?? null;

const content: { [key: string]: object } = {};
content[key] = message;

// const response = await BROWSER.tabs.sendMessage(tab.id as number, content); // ! - see if this works in firefox
await BROWSER.tabs.sendMessage(tab.id as number, content); // ! - see if this works in firefox

// do something with response here, not outside the function
console.log(`[BYS] :: Saving Changes`);
Expand Down

0 comments on commit 7d7fe1c

Please sign in to comment.