File tree 1 file changed +9
-0
lines changed
packages/@vue/cli-shared-utils/lib
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ exports.IpcMessenger = class IpcMessenger {
36
36
this . _reset ( )
37
37
}
38
38
39
+ checkConnection ( ) {
40
+ if ( ! ipc . of [ this . id ] ) {
41
+ this . connected = false
42
+ }
43
+ }
44
+
39
45
send ( data , type = 'message' ) {
46
+ this . checkConnection ( )
40
47
if ( this . connected ) {
41
48
ipc . of [ this . id ] . emit ( type , data )
42
49
@@ -55,6 +62,7 @@ exports.IpcMessenger = class IpcMessenger {
55
62
}
56
63
57
64
connect ( ) {
65
+ this . checkConnection ( )
58
66
if ( this . connected || this . connecting ) return
59
67
this . connecting = true
60
68
this . disconnecting = false
@@ -69,6 +77,7 @@ exports.IpcMessenger = class IpcMessenger {
69
77
}
70
78
71
79
disconnect ( ) {
80
+ this . checkConnection ( )
72
81
if ( ! this . connected || this . disconnecting ) return
73
82
this . disconnecting = true
74
83
this . connecting = false
You can’t perform that action at this time.
0 commit comments