mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 17:09:07 +08:00
resolve promise after puppeteer installed when find it not installed before start chat
This commit is contained in:
@@ -69,13 +69,24 @@ export const runAutoChat = async () => {
|
|||||||
const data = raw
|
const data = raw
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'NEED_RESETUP_DEPENDENCIES':
|
case 'NEED_RESETUP_DEPENDENCIES':
|
||||||
case 'PUPPETEER_DOWNLOAD_ERROR':
|
|
||||||
case 'PUPPETEER_DOWNLOAD_FINISHED':
|
|
||||||
case 'PUPPETEER_DOWNLOAD_PROGRESS': {
|
case 'PUPPETEER_DOWNLOAD_PROGRESS': {
|
||||||
pipe?.write(JSON.stringify(data) + '\r\n')
|
pipe?.write(JSON.stringify(data) + '\r\n')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
case 'PUPPETEER_DOWNLOAD_FINISHED': {
|
||||||
|
subProcessOfCheckAndDownloadDependencies?.kill()
|
||||||
|
pipe?.write(JSON.stringify(data) + '\r\n')
|
||||||
|
resolve(data)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'PUPPETEER_DOWNLOAD_ERROR': {
|
||||||
|
subProcessOfCheckAndDownloadDependencies?.kill()
|
||||||
|
pipe?.write(JSON.stringify(data) + '\r\n')
|
||||||
|
resolve(data)
|
||||||
|
break
|
||||||
|
}
|
||||||
case 'PUPPETEER_MAY_NOT_INSTALLED': {
|
case 'PUPPETEER_MAY_NOT_INSTALLED': {
|
||||||
|
pipe?.write(JSON.stringify(data) + '\r\n')
|
||||||
resolve(data)
|
resolve(data)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user