Skip to content

Commit

Permalink
Revert "clear old content on undefine (#1431)"
Browse files Browse the repository at this point in the history
This reverts commit 7a25fc4.
  • Loading branch information
mbostock committed Jun 6, 2024
1 parent 461ef2b commit 81b3a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const cellsById = new Map();
export function define(cell) {
const {id, inline, inputs = [], outputs = [], body} = cell;
const variables = [];
cellsById.get(id)?.variables.forEach((v) => v.delete());
cellsById.set(id, {cell, variables});
const root = document.querySelector(`#cell-${id}`);
const loading = root.querySelector(".observablehq-loading");
Expand Down Expand Up @@ -94,8 +95,7 @@ function displayBlock(root, value) {
}

export function undefine(id) {
clear(rootsById.get(id));
cellsById.get(id).variables.forEach((v) => v.delete());
cellsById.get(id)?.variables.forEach((v) => v.delete());
cellsById.delete(id);
}

Expand Down

0 comments on commit 81b3a1f

Please sign in to comment.