Fix pending Jupyter workspace handoff
This commit is contained in:
@@ -81,6 +81,7 @@ import {
|
||||
} from "@/components/ui/tooltip";
|
||||
import {
|
||||
clearActiveSessionId,
|
||||
clearPendingWorkspaceSessionId,
|
||||
PENDING_WORKSPACE_SESSION_CHANGED_EVENT,
|
||||
readActiveSessionId,
|
||||
readPendingWorkspaceSessionId,
|
||||
@@ -312,6 +313,11 @@ function usePendingWorkspaceSessionId() {
|
||||
function useCurrentThreadSessionId({ includePending = false } = {}) {
|
||||
const currentRun = useReplayedRunState();
|
||||
const pendingSessionId = usePendingWorkspaceSessionId();
|
||||
useEffect(() => {
|
||||
if (currentRun.sessionId && currentRun.sessionId === pendingSessionId) {
|
||||
clearPendingWorkspaceSessionId();
|
||||
}
|
||||
}, [currentRun.sessionId, pendingSessionId]);
|
||||
return currentRun.sessionId ?? (includePending ? pendingSessionId : null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user