mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: setting: trigger first edit on page load
This commit is contained in:
1 file changed
+11
@@ -149,6 +149,17 @@ export default function ConfigEditor({
|
|||||||
setValue(yaml.load(v));
|
setValue(yaml.load(v));
|
||||||
}, [stringConfig]);
|
}, [stringConfig]);
|
||||||
|
|
||||||
|
// FIXME: Otherwise first form change will be ignored
|
||||||
|
React.useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
updateFromMonaco(`${stringConfig}\n\ndummy: 1`);
|
||||||
|
setTimeout(() => {
|
||||||
|
setStringConfig(stringConfig);
|
||||||
|
setValue(yaml.load(stringConfig));
|
||||||
|
}, 300);
|
||||||
|
}, 300);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const [size, setSize] = React.useState([50, 50]);
|
const [size, setSize] = React.useState([50, 50]);
|
||||||
|
|
||||||
return (<div className="fullscreen-content" style={{ zIndex: 10 }}>
|
return (<div className="fullscreen-content" style={{ zIndex: 10 }}>
|
||||||
|
|||||||
Reference in new issue
Block a user