mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
fix(web): self-heal stuck Cancel send button
This commit is contained in:
@@ -1298,8 +1298,15 @@ sendBtn.addEventListener('click', () => {
|
|||||||
|
|
||||||
function updateSendBtnState() {
|
function updateSendBtnState() {
|
||||||
if (sendBtnMode === 'cancel') {
|
if (sendBtnMode === 'cancel') {
|
||||||
// Don't downgrade a Cancel button on input edits.
|
// Self-heal a stuck Cancel button: if there's no live stream backing
|
||||||
return;
|
// the current request, the cancel state leaked (e.g. a stream ended
|
||||||
|
// without resetting). Recover to Send so the input isn't blocked.
|
||||||
|
if (!activeRequestId || !activeStreams[activeRequestId]) {
|
||||||
|
resetSendBtnSendMode();
|
||||||
|
} else {
|
||||||
|
// Don't downgrade a genuinely active Cancel button on input edits.
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sendBtn.disabled = uploadingCount > 0 || (!chatInput.value.trim() && pendingAttachments.length === 0);
|
sendBtn.disabled = uploadingCount > 0 || (!chatInput.value.trim() && pendingAttachments.length === 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user