File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,7 @@ export const createCaipStream = (portStream: Duplex): Duplex => {
7676 }
7777 } ;
7878
79- /* ---------- 1. Listen for tab / iframe shutdown signals ---------- */
80-
79+ // 1. Listen for tab/iframe shutdown signals
8180 // a. Node-style streams emit 'close' and/or 'end'
8281 portStream . once ?.( 'close' , handlePortGone ) ;
8382 portStream . once ?.( 'end' , handlePortGone ) ;
@@ -88,12 +87,10 @@ export const createCaipStream = (portStream: Duplex): Duplex => {
8887 const rawPort : chrome . runtime . Port | undefined = ( portStream as any ) ?. _port ;
8988 rawPort ?. onDisconnect ?. addListener ( handlePortGone ) ;
9089
91- /* ---------- 2. Wire up the full duplex pipeline ---------- */
92-
90+ // 2. Wire up the full duplex pipeline
9391 pipeline ( portStream , caipStream , portStream , ( err : Error | null ) => {
94- caipStream . substream . destroy ( ) ; // full cleanup
92+ caipStream . substream . destroy ( ) ;
9593
96- // Ignore the normal premature-close that used to spam the console
9794 if ( err && err . message !== 'Premature close' ) {
9895 console . error ( 'MetaMask CAIP stream error:' , err ) ;
9996 }
You can’t perform that action at this time.
0 commit comments