Skip to content

Commit 2d7a9c5

Browse files
authored
fix: skip running an empty cell (#303)
1 parent 16b419f commit 2d7a9c5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ui/src/lib/store/runtimeSlice.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,19 @@ export const createRuntimeSlice: StateCreator<MyState, [], [], RuntimeSlice> = (
448448
console.log("running", id, "remaining number of pods:", chain.length - 1);
449449
// remove the first element
450450
set({ chain: chain.slice(1) });
451-
get().wsSendRun(id);
451+
// If the pod is empty, the kernel won't reply. So, we need to skip it.
452+
if (
453+
get().pods[id].content === undefined ||
454+
get().pods[id].content === ""
455+
) {
456+
set(
457+
produce((state) => {
458+
state.pods[id].running = false;
459+
})
460+
);
461+
} else {
462+
get().wsSendRun(id);
463+
}
452464
}
453465
},
454466
wsInterruptKernel: ({ lang }) => {

0 commit comments

Comments
 (0)