codex-rpc 1.0.0 → 1.0.1
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/codex-rpc.js +3 -2
- package/package.json +1 -1
package/codex-rpc.js
CHANGED
|
@@ -432,8 +432,9 @@ class Presence {
|
|
|
432
432
|
}
|
|
433
433
|
current(now = Date.now()) {
|
|
434
434
|
const age = (now - this.lastActivityTs) / 1000;
|
|
435
|
-
if (this.lastState === 'success'
|
|
436
|
-
return 'success';
|
|
435
|
+
if (this.lastState === 'success') {
|
|
436
|
+
if ((now - this.successTs) / 1000 < this.cfg.successHoldSec) return 'success';
|
|
437
|
+
return 'sleeping';
|
|
437
438
|
}
|
|
438
439
|
if (age > this.cfg.sleepAfterSec) return 'sleeping';
|
|
439
440
|
if (this.lastState === 'error' && (now - this.errorTs) / 1000 < 25) return 'error';
|
package/package.json
CHANGED