fix: enable threaded Flask for SSE and make embed tab switch instant
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user