fix click published
This commit is contained in:
parent
cbb2e21bcd
commit
4773ffd7b0
File diff suppressed because one or more lines are too long
|
|
@ -301,17 +301,14 @@ const handle = async (item: IItem) => {
|
||||||
|
|
||||||
await clickNext();
|
await clickNext();
|
||||||
|
|
||||||
if (import.meta.env.ENV === "prod") {
|
await delay(200);
|
||||||
await delay(200);
|
|
||||||
await clickPublist();
|
await clickPublist();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeTab = async (data: IItem) => {
|
const closeTab = async (data: IItem) => {
|
||||||
await delay(1000);
|
|
||||||
|
|
||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
type: "close-tab",
|
type: "close-tab",
|
||||||
payload: data,
|
payload: data,
|
||||||
|
|
@ -341,19 +338,21 @@ port.onMessage.addListener(async (message) => {
|
||||||
} finally {
|
} finally {
|
||||||
await finistPublist(data, { published: true });
|
await finistPublist(data, { published: true });
|
||||||
|
|
||||||
|
await delay(2000);
|
||||||
|
|
||||||
await closeTab(data);
|
await closeTab(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// async function init() {
|
async function init() {
|
||||||
// const { data } = await axios.get("products/27");
|
const { data } = await axios.get("products/27");
|
||||||
|
|
||||||
// if (!data.data) return;
|
if (!data.data) return;
|
||||||
|
|
||||||
// const item = data.data as IItem;
|
const item = data.data as IItem;
|
||||||
|
|
||||||
// await handle(item);
|
await handle(item);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// init();
|
init();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue