mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:44:33 +00:00
fix(discord): prevent stuck typing indicator
This commit is contained in:
committed by
Nimrod Gutman
parent
fb76e316fb
commit
a0fa283839
@@ -17,6 +17,7 @@ export function createTypingCallbacks(params: {
|
||||
const stop = params.stop;
|
||||
const keepaliveIntervalMs = params.keepaliveIntervalMs ?? 3_000;
|
||||
let stopSent = false;
|
||||
let closed = false;
|
||||
|
||||
const fireStart = async () => {
|
||||
try {
|
||||
@@ -32,6 +33,9 @@ export function createTypingCallbacks(params: {
|
||||
});
|
||||
|
||||
const onReplyStart = async () => {
|
||||
if (closed) {
|
||||
return;
|
||||
}
|
||||
stopSent = false;
|
||||
keepaliveLoop.stop();
|
||||
await fireStart();
|
||||
@@ -39,6 +43,7 @@ export function createTypingCallbacks(params: {
|
||||
};
|
||||
|
||||
const fireStop = () => {
|
||||
closed = true;
|
||||
keepaliveLoop.stop();
|
||||
if (!stop || stopSent) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user