File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
resources/scripts/components/server Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ const terminalProps: ITerminalOptions = {
3838export 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 (
You can’t perform that action at this time.
0 commit comments