mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix fileio pretest
This commit is contained in:
1 parent
dc4464c19a
commit
603f2938fb
6 files changed
+27
-29
No files matched your search
@@ -90,9 +90,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
||||
}
|
||||
const keys = Object.keys(LANGS);
|
||||
if (!keys.includes(this.props.editorLang)) this.props.setEditorLanguage(keys[0]);
|
||||
const canUsePretest = ['default', 'fileio'].includes(UiContext.pdoc.config?.type);
|
||||
return (
|
||||
<Toolbar>
|
||||
{UiContext.pdoc.config?.type === 'default' && (
|
||||
{canUsePretest && (
|
||||
<ToolbarButton
|
||||
disabled={this.props.isPosting || this.props.isRunning}
|
||||
className="scratchpad__toolbar__pretest"
|
||||
@@ -156,7 +157,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
||||
</select>
|
||||
</ToolbarItem>
|
||||
<ToolbarSplit />
|
||||
{['default', 'fileio'].includes(UiContext.pdoc.config?.type) && (
|
||||
{canUsePretest && (
|
||||
<ToolbarButton
|
||||
activated={this.props.pretestVisible}
|
||||
onClick={() => this.props.togglePanel('pretest')}
|
||||
|
||||
Reference in new issue
Block a user