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