@@ -27,6 +27,7 @@ export function Networks() {
27
27
( s ) => s . walletshieldListenAddress ,
28
28
) ;
29
29
30
+ const consoleAddLine = useStore ( ( s ) => s . consoleAddLine ) ;
30
31
const setClientPid = useStore ( ( s ) => s . setClientPid ) ;
31
32
const setIsConnected = useStore ( ( s ) => s . setIsConnected ) ;
32
33
const setMessage = useStore ( ( s ) => s . setMessage ) ;
@@ -156,21 +157,30 @@ export function Networks() {
156
157
PATH : dirNetwork ,
157
158
} ,
158
159
} ) ;
160
+ const o = ( d : string ) => `${ d . trim ( ) } ` ;
159
161
log . debug ( `spawning command: ${ cmd } ${ args . join ( " " ) } ` ) ;
160
162
command . on ( "close" , ( data ) => {
161
163
log . debug ( `closed: ${ cmd } code=${ data . code } signal=${ data . signal } ` ) ;
162
164
setMessage ( "info" , "Network client stopped." ) ;
163
165
} ) ;
164
- command . on ( "error" , ( e ) => log . error ( `${ cmd } : ${ e . trim ( ) } ` ) ) ;
165
- command . stdout . on ( "data" , ( d ) => log . info ( `${ cmd } : ${ d . trim ( ) } ` ) ) ;
166
- command . stderr . on ( "data" , ( d ) => log . error ( `${ cmd } : ${ d . trim ( ) } ` ) ) ;
166
+ command . on ( "error" , ( e ) => log . error ( o ( e ) ) ) ;
167
+
168
+ command . stdout . on ( "data" , ( d ) => {
169
+ log . info ( o ( d ) ) ;
170
+ if ( d . match ( / c l i e n t 2 / ) === null ) consoleAddLine ( o ( d ) ) ;
171
+ } ) ;
172
+
173
+ command . stderr . on ( "data" , ( d ) => {
174
+ log . error ( o ( d ) ) ;
175
+ if ( d . match ( / c l i e n t 2 / ) === null ) consoleAddLine ( o ( d ) ) ;
176
+ } ) ;
167
177
168
178
const child = await command . spawn ( ) ;
169
179
return child . pid ;
170
180
}
171
181
172
182
return (
173
- < div className = "flex flex-col items-center justify-center gap-5 " >
183
+ < div className = "flex flex-col items-center justify-center gap-4 " >
174
184
< img
175
185
src = "/zkn.svg"
176
186
alt = "ZKN"
0 commit comments