Skip to content

Commit

Permalink
feat: ✨ no method error handle for non terminal (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshosale authored Sep 30, 2024
1 parent 15c5426 commit e56d608
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ export function parseGeoLocation(latitude: string, longitude: string): Array<num

export async function waitForKey(message: string) {
signale.pause(message);
process.stdin.setRawMode(true);
if (process.stdin.isTTY)
process.stdin.setRawMode(true);
return new Promise(resolve => process.stdin.once('data', () => {
process.stdin.setRawMode(false);
if (process.stdin.isTTY)
process.stdin.setRawMode(false);
resolve(undefined);
}));
}
Expand Down

0 comments on commit e56d608

Please sign in to comment.