diff --git a/frontend/components/RijuEditor.js b/frontend/components/RijuEditor.js index 1742f1f..4446520 100644 --- a/frontend/components/RijuEditor.js +++ b/frontend/components/RijuEditor.js @@ -1,4 +1,5 @@ import MonacoEditor from "@monaco-editor/react"; + import { createConnection, MonacoLanguageClient, @@ -36,7 +37,7 @@ const RijuEditor = (props) => { } }); () => { - EventEmitter.unsubcribe(token1, token2); + EventEmitter.unsubscribe(token1, token2); if (clientDisposable) { clientDisposable.dispose(); clientDisposable = null; @@ -58,16 +59,16 @@ const RijuEditor = (props) => { // const newURI = `file://${message.root}/${config.main}`; // const oldModel = editor.getModel(); // if (oldModel.uri.toString() !== newURI) { - // This code is likely to be buggy as it will probably - // never run and has thus never been tested. - // editor.setModel( - // monaco.editor.createModel( - // oldModel?.getValue(), - // undefined, - // monaco.Uri.parse(newURI) - // ) - // ); - // oldModel.dispose(); + // // This code is likely to be buggy as it will probably + // // never run and has thus never been tested. + // editor.setModel( + // monaco.editor.createModel( + // oldModel?.getValue(), + // undefined, + // monaco.Uri.parse(newURI) + // ) + // ); + // oldModel.dispose(); // } const connection = createMessageConnection( diff --git a/frontend/components/RijuTerminal.js b/frontend/components/RijuTerminal.js index 2726947..c4e7d53 100644 --- a/frontend/components/RijuTerminal.js +++ b/frontend/components/RijuTerminal.js @@ -42,7 +42,7 @@ function RijuTerminal() { EventEmitter.dispatch("send", { event: "terminalInput", input: data }); }); - () => EventEmitter.unsubcribe(token1, token2); + () => EventEmitter.unsubscribe(token1, token2); }, []); return ( diff --git a/frontend/utils/EventEmitter.js b/frontend/utils/EventEmitter.js index 596cf29..7842b64 100644 --- a/frontend/utils/EventEmitter.js +++ b/frontend/utils/EventEmitter.js @@ -15,11 +15,11 @@ export const EventEmitter = { this.events[event][token] = callback; return token; }, - unsubcribe: function (...tokens) { - for (let k of Object.keys(events)) { - let toks = Object.keys(events[k]); + unsubscribe: function (...tokens) { + for (let k of Object.keys(this.events)) { + let toks = Object.keys(this.events[k]); for (let tok of toks) { - if (tokens.includes(tok)) delete events[k][tok]; + if (tokens.includes(tok)) delete this.events[k][tok]; } } },