ui: bug fix

pull/434/head
undefined 2 years ago
parent c0550fc97c
commit 2e050f5851

@ -37,7 +37,7 @@ export default connect((state: any) => ({
const { language } = this.props; const { language } = this.props;
const { monaco, registerAction, customOptions } = await load([language]); const { monaco, registerAction, customOptions } = await load([language]);
const uri = monaco.Uri.parse(`hydro://${UiContext.pdoc.pid || UiContext.pdoc.docId}.${language}`); const uri = monaco.Uri.parse(`hydro://${UiContext.pdoc.pid || UiContext.pdoc.docId}.${language}`);
this.model = monaco.editor.createModel(value, language, uri); this.model = monaco.editor.getModel(uri) || monaco.editor.createModel(value, language, uri);
if (this.containerElement) { if (this.containerElement) {
const config: monaco.editor.IStandaloneEditorConstructionOptions = { const config: monaco.editor.IStandaloneEditorConstructionOptions = {
theme: 'vs-light', theme: 'vs-light',

@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.40.10", "version": "4.40.11",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",

@ -2,7 +2,6 @@ declare global {
interface Window { interface Window {
node_modules: any; node_modules: any;
LANGS: Record<string, any>; LANGS: Record<string, any>;
} }
let UserContext: Record<string, any>; let UserContext: Record<string, any>;

Loading…
Cancel
Save