picosh 0.2.6 → 0.2.7
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/index.js +7 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -73,20 +73,19 @@ exports.middleware = () => (next) => (action) => {
|
|
|
73
73
|
const uid = action.uid || activeUid;
|
|
74
74
|
const {data} = action;
|
|
75
75
|
const clean = data.replace(ANSI_RE, '');
|
|
76
|
-
console.log('[picosh]
|
|
76
|
+
console.log('[picosh] ADD_DATA uid:', uid ? uid.slice(0, 8) : 'NONE', JSON.stringify(clean.slice(-40)));
|
|
77
77
|
|
|
78
78
|
clearTimeout(timers[uid]);
|
|
79
|
-
setWaiting(uid, false);
|
|
80
|
-
|
|
81
79
|
timers[uid] = setTimeout(() => {
|
|
82
80
|
const matched = PROMPT_RE.test(clean);
|
|
83
|
-
console.log('[picosh] timer fired,
|
|
84
|
-
|
|
85
|
-
},
|
|
81
|
+
console.log('[picosh] timer fired, match:', matched);
|
|
82
|
+
setWaiting(uid, matched);
|
|
83
|
+
}, 300);
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
if (action.type === '
|
|
89
|
-
const uid =
|
|
86
|
+
if (action.type === 'SESSION_USER_DATA') {
|
|
87
|
+
const uid = activeUid;
|
|
88
|
+
console.log('[picosh] USER_DATA → reset waiting');
|
|
90
89
|
clearTimeout(timers[uid]);
|
|
91
90
|
setWaiting(uid, false);
|
|
92
91
|
}
|