polfan-server-js-client 0.2.40 → 0.2.42

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.
@@ -5,4 +5,5 @@ export interface Emoticon {
5
5
  name: string;
6
6
  fileId: string;
7
7
  user: User;
8
+ tag?: string;
8
9
  }
@@ -4,4 +4,5 @@ export interface SpaceSummary {
4
4
  description: string;
5
5
  icon?: string;
6
6
  banner?: string;
7
+ memberCount: number;
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polfan-server-js-client",
3
- "version": "0.2.40",
3
+ "version": "0.2.42",
4
4
  "description": "JavaScript client library for handling communication with Polfan chat server.",
5
5
  "author": "Jarosław Żak",
6
6
  "license": "MIT",
@@ -21,18 +21,20 @@ export class EmoticonsManager {
21
21
  }
22
22
 
23
23
  public async get(spaceId?: string): Promise<ObservableIndexedObjectCollection<Emoticon>> {
24
- if (this.emoticonsPromises.notExist(spaceId)) {
24
+ const key = spaceId ?? GLOBAL_KEY;
25
+
26
+ if (this.emoticonsPromises.notExist(key)) {
25
27
  this.emoticonsPromises.registerByFunction(async () => {
26
28
  const result = await this.tracker.client.send('GetEmoticons', {spaceId});
27
29
  if (result.error) {
28
30
  throw result.error;
29
31
  }
30
32
  this.handleEmoticons(result.data);
31
- }, spaceId ?? GLOBAL_KEY);
33
+ }, key);
32
34
  }
33
35
 
34
- await this.emoticonsPromises.get(spaceId);
35
- return this.list.get(spaceId);
36
+ await this.emoticonsPromises.get(key);
37
+ return this.list.get(key);
36
38
  }
37
39
 
38
40
  private handleEmoticons(event: Emoticons): void {
@@ -6,4 +6,5 @@ export interface Emoticon {
6
6
  name: string;
7
7
  fileId: string;
8
8
  user: User;
9
+ tag?: string;
9
10
  }
@@ -4,4 +4,5 @@ export interface SpaceSummary {
4
4
  description: string;
5
5
  icon?: string;
6
6
  banner?: string;
7
+ memberCount: number;
7
8
  }