hedgequantx 1.8.37 → 1.8.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.js +6 -1
- package/src/utils/prompts.js +3 -1
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -245,7 +245,12 @@ const run = async () => {
|
|
|
245
245
|
}
|
|
246
246
|
break;
|
|
247
247
|
case 'algotrading':
|
|
248
|
-
|
|
248
|
+
try {
|
|
249
|
+
await algoTradingMenu(currentService);
|
|
250
|
+
} catch (algoErr) {
|
|
251
|
+
console.log(chalk.red(` Algo error: ${algoErr.message}`));
|
|
252
|
+
prepareStdin();
|
|
253
|
+
}
|
|
249
254
|
break;
|
|
250
255
|
case 'update':
|
|
251
256
|
await handleUpdate();
|
package/src/utils/prompts.js
CHANGED
|
@@ -24,7 +24,7 @@ const getReadline = () => {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Ensure stdin is ready
|
|
27
|
+
* Ensure stdin is ready and flush any buffered input
|
|
28
28
|
*/
|
|
29
29
|
const prepareStdin = () => {
|
|
30
30
|
try {
|
|
@@ -32,6 +32,8 @@ const prepareStdin = () => {
|
|
|
32
32
|
if (process.stdin.isTTY && process.stdin.setRawMode) {
|
|
33
33
|
process.stdin.setRawMode(false);
|
|
34
34
|
}
|
|
35
|
+
// Flush any buffered input by reading without waiting
|
|
36
|
+
process.stdin.read();
|
|
35
37
|
} catch (e) {}
|
|
36
38
|
};
|
|
37
39
|
|