@maxzima/wa-communicator 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,6 +70,7 @@ export class CommunicatorReceiver {
|
|
|
70
70
|
item.action === params.action;
|
|
71
71
|
})) {
|
|
72
72
|
console.log(`WAB: subscribe is exists!`);
|
|
73
|
+
return;
|
|
73
74
|
}
|
|
74
75
|
const newQueueItem = {
|
|
75
76
|
target: params.target,
|
|
@@ -84,7 +85,7 @@ export class CommunicatorReceiver {
|
|
|
84
85
|
this.queue.push(newQueueItem);
|
|
85
86
|
};
|
|
86
87
|
this.unsubscribe = (params) => {
|
|
87
|
-
if (!params) {
|
|
88
|
+
if (!params || Object.keys(params).length === 0) {
|
|
88
89
|
this.queue = [];
|
|
89
90
|
return true;
|
|
90
91
|
}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -14,14 +14,6 @@ import {
|
|
|
14
14
|
CommunicatorActionEnum_scenario
|
|
15
15
|
} from '../enums/CommunicatorActionEnum';
|
|
16
16
|
|
|
17
|
-
// const defaultScenario = [
|
|
18
|
-
// CommunicatorActionEnum.TOKEN,
|
|
19
|
-
// CommunicatorActionEnum.RESIZE,
|
|
20
|
-
// CommunicatorActionEnum.GOTO,
|
|
21
|
-
// CommunicatorActionEnum.CLOSE,
|
|
22
|
-
// CommunicatorActionEnum.OPEN,
|
|
23
|
-
// ];
|
|
24
|
-
|
|
25
17
|
export class CommunicatorReceiver {
|
|
26
18
|
private readonly senderOrigin: string;
|
|
27
19
|
private queue: TReceiverMessageQueue = [];
|
|
@@ -126,6 +118,7 @@ export class CommunicatorReceiver {
|
|
|
126
118
|
item.action === params.action;
|
|
127
119
|
})) {
|
|
128
120
|
console.log(`WAB: subscribe is exists!`);
|
|
121
|
+
return;
|
|
129
122
|
}
|
|
130
123
|
|
|
131
124
|
const newQueueItem = {
|
|
@@ -148,7 +141,7 @@ export class CommunicatorReceiver {
|
|
|
148
141
|
* @param params
|
|
149
142
|
*/
|
|
150
143
|
public unsubscribe = (params?: TReceiverUnsubscribeMessageParams): boolean => {
|
|
151
|
-
if (!params) {
|
|
144
|
+
if (!params || Object.keys(params).length === 0) {
|
|
152
145
|
this.queue = [];
|
|
153
146
|
return true;
|
|
154
147
|
}
|