mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: scratchpad: allow pretest for validAs lang entries
This commit is contained in:
1 file changed
+5
-3
@@ -101,10 +101,12 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let canUsePretest = ['default', 'fileio'].includes(UiContext.pdoc.config?.type);
|
let canUsePretest = ['default', 'fileio'].includes(UiContext.pdoc.config?.type);
|
||||||
if (UiContext.pdoc.config?.type === 'remote_judge') {
|
const langInfo = availableLangs[this.props.editorLang];
|
||||||
if (availableLangs[this.props.editorLang].pretest) canUsePretest = true;
|
if (UiContext.pdoc.config?.type === 'remote_judge' && langInfo) {
|
||||||
|
if (langInfo.pretest) canUsePretest = true;
|
||||||
|
if (langInfo.validAs && !langInfo.hidden) canUsePretest = true;
|
||||||
}
|
}
|
||||||
if (availableLangs[this.props.editorLang]?.pretest === false) canUsePretest = false;
|
if (langInfo?.pretest === false) canUsePretest = false;
|
||||||
return (
|
return (
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
{canUsePretest && (
|
{canUsePretest && (
|
||||||
|
|||||||
Reference in new issue
Block a user