@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
  }
@@ -12,7 +12,7 @@ export declare type TCommunicatorActionTokenParams = {
12
12
  name: string;
13
13
  value: string;
14
14
  domain: string;
15
- expires: string;
15
+ expires?: string;
16
16
  };
17
17
  export declare type TCommunicatorActionResizeParams = {
18
18
  width?: number;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.11",
2
+ "version": "0.0.12",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -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
  }
@@ -16,7 +16,7 @@ export type TCommunicatorActionTokenParams = {
16
16
  name: string,
17
17
  value: string,
18
18
  domain: string,
19
- expires: string,
19
+ expires?: string,
20
20
  }
21
21
 
22
22
  export type TCommunicatorActionResizeParams = {