Skip to content

Commit 8fe7140

Browse files
committed
ui: only render problem selection element when exists
1 parent 20686ca commit 8fe7140

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

packages/ui-default/pages/problem_main.page.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,14 @@ const page = new NamedPage(['problem_main'], () => {
454454
$(document).on('vjContentNew', (e) => processElement(e.target));
455455
processElement(document);
456456

457-
ReactDOM.createRoot(document.getElementById('problem_selection'))
458-
.render(<ProblemSelectionDisplay
459-
onChange={(pids) => { selectedPids = pids; }}
460-
onClear={(handler) => { clearSelectionHandler = handler; }}
461-
/>);
457+
const selection = document.getElementById('problem_selection');
458+
if (selection) {
459+
ReactDOM.createRoot(selection)
460+
.render(<ProblemSelectionDisplay
461+
onChange={(pids) => { selectedPids = pids; }}
462+
onClear={(handler) => { clearSelectionHandler = handler; }}
463+
/>);
464+
}
462465

463466
addSpeculationRules({
464467
prerender: [{

0 commit comments

Comments
 (0)