remove period screenshot

This commit is contained in:
geekgeekrun
2026-01-22 13:24:43 +08:00
parent afe8a820c1
commit 5ab7fc2ee2
2 changed files with 24 additions and 24 deletions
@@ -15,7 +15,7 @@ import SqlitePluginModule from '@geekgeekrun/sqlite-plugin'
import gtag from '../../utils/gtag' import gtag from '../../utils/gtag'
import GtagPlugin from '../../utils/gtag/GtagPlugin' import GtagPlugin from '../../utils/gtag/GtagPlugin'
import { connectToDaemon, sendToDaemon } from '../OPEN_SETTING_WINDOW/connect-to-daemon' import { connectToDaemon, sendToDaemon } from '../OPEN_SETTING_WINDOW/connect-to-daemon'
import { PeriodPushCurrentPageScreenshotPlugin } from '../../utils/screenshot' // import { PeriodPushCurrentPageScreenshotPlugin } from '../../utils/screenshot'
import { checkShouldExit } from '../../utils/worker' import { checkShouldExit } from '../../utils/worker'
import { UserResponseInfoPlugin } from '../../features/boss-user-info-response-plugin' import { UserResponseInfoPlugin } from '../../features/boss-user-info-response-plugin'
const { default: SqlitePlugin } = SqlitePluginModule const { default: SqlitePlugin } = SqlitePluginModule
@@ -35,7 +35,7 @@ const initPlugins = (hooks) => {
new DingtalkPlugin(dingTalkAccessToken).apply(hooks) new DingtalkPlugin(dingTalkAccessToken).apply(hooks)
new SqlitePlugin(getPublicDbFilePath()).apply(hooks) new SqlitePlugin(getPublicDbFilePath()).apply(hooks)
new GtagPlugin().apply(hooks) new GtagPlugin().apply(hooks)
new PeriodPushCurrentPageScreenshotPlugin().apply(hooks) // new PeriodPushCurrentPageScreenshotPlugin().apply(hooks)
new UserResponseInfoPlugin().apply(hooks) new UserResponseInfoPlugin().apply(hooks)
} }
@@ -52,29 +52,29 @@ export const pageMapByName: {
boss?: Page | null boss?: Page | null
} = {} } = {}
async function periodPushCurrentPageScreenshot () { // async function periodPushCurrentPageScreenshot () {
try { // try {
if (pageMapByName.boss?.isClosed()) { // if (pageMapByName.boss?.isClosed()) {
return // return
} // }
const shouldExit = await checkShouldExit() // const shouldExit = await checkShouldExit()
if (shouldExit) { // if (shouldExit) {
return // return
} // }
try { // try {
await pushCurrentPageScreenshot(pageMapByName.boss) // await pushCurrentPageScreenshot(pageMapByName.boss)
} // }
catch (err) { // catch (err) {
if (err?.message?.includes(`PAGE_CLOSED`)) { // if (err?.message?.includes(`PAGE_CLOSED`)) {
return // return
} // }
} // }
setTimeout(periodPushCurrentPageScreenshot, SCREENSHOT_INTERVAL_MS) // setTimeout(periodPushCurrentPageScreenshot, SCREENSHOT_INTERVAL_MS)
} // }
catch {} // catch {}
} // }
periodPushCurrentPageScreenshot() // periodPushCurrentPageScreenshot()
async function saveCurrentChatRecord(page) { async function saveCurrentChatRecord(page) {
const userInfo = await page.evaluate( const userInfo = await page.evaluate(