fix: enable threaded Flask for SSE and make embed tab switch instant

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 11:09:34 +08:00
parent 3db84d07e3
commit 799a4d6b8b
5 changed files with 76 additions and 15 deletions
+7 -3
View File
@@ -32,8 +32,14 @@
}
function onLiveEvent(data) {
const reason = data && data.reason;
const ver = Number(data && data.live_version) || 0;
if (!ver || ver === localLiveVersion) return;
if (!ver) return;
if (reason === "connect") {
localLiveVersion = ver;
return;
}
if (ver === localLiveVersion) return;
localLiveVersion = ver;
refreshTabData(currentTab(), { silent: true });
}
@@ -67,14 +73,12 @@
closeLiveStream();
liveReconnectTimer = setTimeout(function () {
connectLiveStream();
refreshTabData(currentTab(), { silent: true });
}, 8000);
};
}
function startLive() {
if (!isEmbedShell()) return;
refreshTabData(currentTab());
connectLiveStream();
}