mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-05 23:47:54 +08:00
refactor all import in src/main to async import
This commit is contained in:
@@ -1,29 +1,37 @@
|
|||||||
import { runAutoChat } from './flow/GEEK_AUTO_START_CHAT_WITH_BOSS_MAIN/index'
|
|
||||||
import { runAutoChatWithDaemon } from './flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index'
|
|
||||||
import { openSettingWindow } from './flow/OPEN_SETTING_WINDOW'
|
|
||||||
import { checkAndDownloadDependenciesForInit } from './flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/index'
|
|
||||||
import { launchBossZhipinLoginPageWithPreloadExtension } from './flow/LAUNCH_BOSS_ZHIPIN_LOGIN_PAGE_WITH_PRELOAD_EXTENSION'
|
|
||||||
|
|
||||||
const runMode = process.env.MAIN_BOSSGEEKGO_UI_RUN_MODE
|
const runMode = process.env.MAIN_BOSSGEEKGO_UI_RUN_MODE
|
||||||
switch (runMode) {
|
|
||||||
case 'geekAutoStartWithBossMain': {
|
;(async () => {
|
||||||
runAutoChat()
|
switch (runMode) {
|
||||||
break
|
case 'geekAutoStartWithBossMain': {
|
||||||
|
const { runAutoChat } = await import('./flow/GEEK_AUTO_START_CHAT_WITH_BOSS_MAIN/index')
|
||||||
|
runAutoChat()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'geekAutoStartWithBossDaemon': {
|
||||||
|
const { runAutoChatWithDaemon } = await import(
|
||||||
|
'./flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index'
|
||||||
|
)
|
||||||
|
runAutoChatWithDaemon()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'checkAndDownloadDependenciesForInit': {
|
||||||
|
const { checkAndDownloadDependenciesForInit } = await import(
|
||||||
|
'./flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/index'
|
||||||
|
)
|
||||||
|
checkAndDownloadDependenciesForInit()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'launchBossZhipinLoginPageWithPreloadExtension': {
|
||||||
|
const { launchBossZhipinLoginPageWithPreloadExtension } = await import(
|
||||||
|
'./flow/LAUNCH_BOSS_ZHIPIN_LOGIN_PAGE_WITH_PRELOAD_EXTENSION'
|
||||||
|
)
|
||||||
|
launchBossZhipinLoginPageWithPreloadExtension()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
const { openSettingWindow } = await import('./flow/OPEN_SETTING_WINDOW')
|
||||||
|
openSettingWindow()
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case 'geekAutoStartWithBossDaemon': {
|
})()
|
||||||
runAutoChatWithDaemon()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case 'checkAndDownloadDependenciesForInit': {
|
|
||||||
checkAndDownloadDependenciesForInit()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case 'launchBossZhipinLoginPageWithPreloadExtension': {
|
|
||||||
launchBossZhipinLoginPageWithPreloadExtension()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
openSettingWindow()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user