mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-06-02 06:00:43 +08:00
add the exit logic of read no reply auto reminder
This commit is contained in:
@@ -275,6 +275,13 @@ export default function initIpc() {
|
||||
ipcMain.handle('stop-geek-auto-start-chat-with-boss', async () => {
|
||||
mainWindow?.webContents.send('geek-auto-start-chat-with-boss-stopping')
|
||||
subProcessOfPuppeteer?.kill()
|
||||
setTimeout(() => {
|
||||
try {
|
||||
subProcessOfPuppeteer?.kill('SIGKILL')
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
let subProcessOfBossZhipinLoginPageWithPreloadExtension: ChildProcess | null = null
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function bootstrap() {
|
||||
}
|
||||
|
||||
export async function launchBoss(browser: Browser) {
|
||||
const page = await browser.newPage()
|
||||
const page = (await browser.pages())[0]
|
||||
//set cookies
|
||||
for (let i = 0; i < bossCookies.length; i++) {
|
||||
await page.setCookie(bossCookies[i])
|
||||
@@ -35,6 +35,11 @@ export async function launchBoss(browser: Browser) {
|
||||
await setDomainLocalStorage(browser, localStoragePageUrl, bossLocalStorage)
|
||||
await Promise.all([page.goto(bossChatUiUrl, { timeout: 0 }), page.waitForNavigation()])
|
||||
pageMapByName['boss'] = page
|
||||
page.once('close', () => (pageMapByName['boss'] = null))
|
||||
page.once('close', () => {
|
||||
pageMapByName['boss'] = null
|
||||
const cp = browser.process()
|
||||
cp?.kill()
|
||||
process.exit(0)
|
||||
})
|
||||
return page
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user