File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
import type { Fn } from '@ora-io/utils'
2
+ import { isWin } from '@ora-io/utils/os'
2
3
import type { Interface , InterfaceAbi } from 'ethers'
3
4
import { ethers } from 'ethers'
4
5
@@ -31,10 +32,15 @@ export class ContractManager {
31
32
}
32
33
33
34
removeAllListeners ( ) {
35
+ if ( ! isWin )
36
+ this . _contract ?. removeAllListeners ( )
37
+
34
38
for ( const [ event , listener ] of this . _listeners )
35
39
this . _contract ?. off ( event , listener )
36
40
37
- this . _contract ?. removeAllListeners ( )
41
+ if ( isWin )
42
+ this . _contract ?. removeAllListeners ( )
43
+
38
44
this . _listeners . clear ( )
39
45
}
40
46
Original file line number Diff line number Diff line change
1
+ export const isWin = process . platform === 'win32'
2
+ export const isMac = process . platform === 'darwin'
3
+ export const isLinux = process . platform === 'linux'
You can’t perform that action at this time.
0 commit comments