Skip to content

Commit 4e3e9a9

Browse files
committed
eslint error fixes
1 parent bfd6230 commit 4e3e9a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

resources/scripts/components/server/Console.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ const terminalProps: ITerminalOptions = {
3838
export default () => {
3939
const ref = createRef<HTMLDivElement>();
4040
const terminal = useMemo(() => new Terminal({ ...terminalProps }), []);
41-
const connected = ServerContext.useStoreState(state => state.socket.connected);
42-
const instance = ServerContext.useStoreState(state => state.socket.instance);
41+
const { connected, instance } = ServerContext.useStoreState(state => state.socket);
4342

4443
const handleConsoleOutput = (line: string) => terminal.writeln(
4544
line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m',
@@ -70,7 +69,7 @@ export default () => {
7069
// @see https://github.com/xtermjs/xterm.js/issues/2230
7170
TerminalFit.fit(terminal);
7271
}
73-
}, [ ref.current ]);
72+
}, [terminal, ref]);
7473

7574
useEffect(() => {
7675
if (connected && instance) {
@@ -87,6 +86,7 @@ export default () => {
8786
.removeListener('daemon error', handleDaemonErrorOutput)
8887
.removeListener('status', handlePowerChangeEvent);
8988
};
89+
// eslint-disable-next-line react-hooks/exhaustive-deps
9090
}, [ connected, instance ]);
9191

9292
return (

0 commit comments

Comments
 (0)