mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: only render problem selection element when exists
This commit is contained in:
1 file changed
+8
-5
@@ -454,11 +454,14 @@ const page = new NamedPage(['problem_main'], () => {
|
||||
$(document).on('vjContentNew', (e) => processElement(e.target));
|
||||
processElement(document);
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('problem_selection'))
|
||||
.render(<ProblemSelectionDisplay
|
||||
onChange={(pids) => { selectedPids = pids; }}
|
||||
onClear={(handler) => { clearSelectionHandler = handler; }}
|
||||
/>);
|
||||
const selection = document.getElementById('problem_selection');
|
||||
if (selection) {
|
||||
ReactDOM.createRoot(selection)
|
||||
.render(<ProblemSelectionDisplay
|
||||
onChange={(pids) => { selectedPids = pids; }}
|
||||
onClear={(handler) => { clearSelectionHandler = handler; }}
|
||||
/>);
|
||||
}
|
||||
|
||||
addSpeculationRules({
|
||||
prerender: [{
|
||||
|
||||
Reference in new issue
Block a user