refactor: polish the tailwind refactor

This commit is contained in:
Tristan Yang
2023-02-09 17:50:42 +08:00
parent 0b817773a0
commit 446e9a17d9
38 changed files with 80 additions and 70 deletions
+4 -2
View File
@@ -64,7 +64,10 @@ export default function useStreaming() {
}, timeout ?? 20000);
};
const startStreaming = useCallback(async () => {
if (connectionIsOpen) return;
if (connectionIsOpen) {
console.log("connection is open, return");
return;
};
window.clearTimeout(aliveInter);
if (SSE && (SSE.readyState === EventSource.OPEN || SSE.readyState === EventSource.CONNECTING))
return;
@@ -116,7 +119,6 @@ export default function useStreaming() {
return;
}
// 重连
// connectionIsOpen = false;
keepAlive(2000);
};
SSE.onmessage = (evt) => {