@glissandoo/lib 1.1.10 → 1.1.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.
@@ -25,6 +25,7 @@ export declare enum AppScenes {
25
25
  EditProfileDescription = "EditProfileDescription",
26
26
  EditProfileLanguage = "EditProfileLanguage",
27
27
  CommunicationList = "communications",
28
+ CommunicationNewComment = "communicationNewComment",
28
29
  Communication = "communication",
29
30
  EventList = "events",
30
31
  Event = "event",
@@ -29,6 +29,7 @@ var AppScenes;
29
29
  AppScenes["EditProfileDescription"] = "EditProfileDescription";
30
30
  AppScenes["EditProfileLanguage"] = "EditProfileLanguage";
31
31
  AppScenes["CommunicationList"] = "communications";
32
+ AppScenes["CommunicationNewComment"] = "communicationNewComment";
32
33
  AppScenes["Communication"] = "communication";
33
34
  AppScenes["EventList"] = "events";
34
35
  AppScenes["Event"] = "event";
@@ -36,4 +36,5 @@ export default class Communication extends Model<CommunicationData> {
36
36
  get totalViews(): number;
37
37
  get isServer(): boolean;
38
38
  getRecipient: (userId: string) => import("./types").CommunicationRecipientData | null;
39
+ getReactionsOrdered(maxItems?: number): [string, string[]][];
39
40
  }
@@ -104,5 +104,9 @@ class Communication extends Model_1.default {
104
104
  get isServer() {
105
105
  return this.data.server === true;
106
106
  }
107
+ getReactionsOrdered(maxItems) {
108
+ const array = lodash_1.sortBy(Object.entries(this.reactions), [(e) => e[1].length]).reverse();
109
+ return maxItems ? array.slice(0, maxItems) : array;
110
+ }
107
111
  }
108
112
  exports.default = Communication;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",