Fixed typo
This commit is contained in:
parent
f3172ca397
commit
5aab10c613
|
@ -1,4 +1,5 @@
|
||||||
import MonacoEditor from "@monaco-editor/react";
|
import MonacoEditor from "@monaco-editor/react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createConnection,
|
createConnection,
|
||||||
MonacoLanguageClient,
|
MonacoLanguageClient,
|
||||||
|
@ -36,7 +37,7 @@ const RijuEditor = (props) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
() => {
|
() => {
|
||||||
EventEmitter.unsubcribe(token1, token2);
|
EventEmitter.unsubscribe(token1, token2);
|
||||||
if (clientDisposable) {
|
if (clientDisposable) {
|
||||||
clientDisposable.dispose();
|
clientDisposable.dispose();
|
||||||
clientDisposable = null;
|
clientDisposable = null;
|
||||||
|
@ -58,8 +59,8 @@ const RijuEditor = (props) => {
|
||||||
// const newURI = `file://${message.root}/${config.main}`;
|
// const newURI = `file://${message.root}/${config.main}`;
|
||||||
// const oldModel = editor.getModel();
|
// const oldModel = editor.getModel();
|
||||||
// if (oldModel.uri.toString() !== newURI) {
|
// if (oldModel.uri.toString() !== newURI) {
|
||||||
// This code is likely to be buggy as it will probably
|
// // This code is likely to be buggy as it will probably
|
||||||
// never run and has thus never been tested.
|
// // never run and has thus never been tested.
|
||||||
// editor.setModel(
|
// editor.setModel(
|
||||||
// monaco.editor.createModel(
|
// monaco.editor.createModel(
|
||||||
// oldModel?.getValue(),
|
// oldModel?.getValue(),
|
||||||
|
|
|
@ -42,7 +42,7 @@ function RijuTerminal() {
|
||||||
EventEmitter.dispatch("send", { event: "terminalInput", input: data });
|
EventEmitter.dispatch("send", { event: "terminalInput", input: data });
|
||||||
});
|
});
|
||||||
|
|
||||||
() => EventEmitter.unsubcribe(token1, token2);
|
() => EventEmitter.unsubscribe(token1, token2);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -15,11 +15,11 @@ export const EventEmitter = {
|
||||||
this.events[event][token] = callback;
|
this.events[event][token] = callback;
|
||||||
return token;
|
return token;
|
||||||
},
|
},
|
||||||
unsubcribe: function (...tokens) {
|
unsubscribe: function (...tokens) {
|
||||||
for (let k of Object.keys(events)) {
|
for (let k of Object.keys(this.events)) {
|
||||||
let toks = Object.keys(events[k]);
|
let toks = Object.keys(this.events[k]);
|
||||||
for (let tok of toks) {
|
for (let tok of toks) {
|
||||||
if (tokens.includes(tok)) delete events[k][tok];
|
if (tokens.includes(tok)) delete this.events[k][tok];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue