Skip to content

Commit 482183a

Browse files
committed
🚑 fix: #2648
1 parent 7abab32 commit 482183a

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

src/cli/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ async function start() {
174174
spinner.succeed(`Port ${PORT} is now free.`);
175175
server.listen(PORT, async () => {
176176
spinner.succeed(`\n• Listening on port ${PORT}!`);
177-
await processSendData({port:PORT})
177+
processSendData({port:PORT})
178178
await ready({...cliConfig, ...createConfig, ...client.getSessionInfo(), hostAccountNumber: await client.getHostNumber()});
179179
});
180180
process.on('message', async function (data : any) {
181181
if(data?.data?.command === "port_report") {
182182
const response = {port:PORT};
183-
await processSendData(response);
183+
processSendData(response);
184184
return response
185185
}
186186
});

src/controllers/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ ON_DEATH(async () => {
447447
* @internal
448448
*/
449449
export const kill = async (p: Page, b?: Browser, exit ?: boolean, pid ?: number, reason = "LAUNCH_KILL") => {
450-
await processSendData({
450+
processSendData({
451451
reason
452452
})
453453
timeout(3000)

src/controllers/popup/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function popup(config: ConfigObject) : Promise<string> {
9494
});
9595
});
9696
server.listen(PORT);
97-
await processSendData({port:PORT})
97+
processSendData({port:PORT})
9898
const os = osName();
9999
const appName = os.includes('macOS') ? 'google chrome' : os.includes('Windows') ? 'chrome' : 'google-chrome';
100100
const hasChrome = await commandExists(appName).then(()=>true).catch(()=>false);

src/utils/tools.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,19 @@ export async function timePromise(fn: () => Promise<any>): Promise<string> {
201201
* @param {any} data - The data to be sent to the parent process.
202202
* @returns Nothing.
203203
*/
204-
export const processSendData = async (data : any = {}) => {
205-
const sd = (resolve,reject) => process.send({
204+
export const processSendData = (data : any = {}) => {
205+
const sd = () => process.send({
206206
type : 'process:msg',
207207
data
208208
}, (error) => {
209209
if (error) {
210210
console.error(error);
211-
reject(error)
212211
}
213-
resolve(true)
214212
})
215-
return await new Promise((resolve, reject)=>{
216-
sd(resolve,reject)
217-
})
213+
return sd()
214+
// return await new Promise((resolve, reject)=>{
215+
// sd(resolve,reject)
216+
// })
218217
}
219218

220219
/**

0 commit comments

Comments
 (0)