@glissandoo/lib 1.18.0 → 1.18.1

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.
@@ -55,7 +55,7 @@ export default class GroupRepertory extends Theme<GroupRepertoryData> {
55
55
  get thumbnailURL(): string | null;
56
56
  get ownerId(): string;
57
57
  get lastEventDatetime(): firestore.Timestamp | null;
58
- get claims(): Record<InstrumentId, Record<string, import("./types").GroupRepertoryClaimType>>;
58
+ get claims(): Partial<Record<InstrumentId, Record<string, import("./types").GroupRepertoryClaimType>>>;
59
59
  get claimsList(): {
60
60
  createdAt: firestore.Timestamp;
61
61
  notifiedAt: firestore.Timestamp | null;
@@ -133,7 +133,7 @@ class GroupRepertory extends basic_1.default {
133
133
  }
134
134
  get claimsList() {
135
135
  return (0, ts_extras_1.objectEntries)(this.claims)
136
- .map(([iId, users]) => (0, ts_extras_1.objectEntries)(users).map(([userId, claim]) => ({
136
+ .map(([iId, users]) => (0, ts_extras_1.objectEntries)(users || {}).map(([userId, claim]) => ({
137
137
  userId,
138
138
  instrumentId: iId,
139
139
  hasFile: this.hasInstrumentAFile(iId),
@@ -149,7 +149,7 @@ class GroupRepertory extends basic_1.default {
149
149
  if (!this.isInstrumentClaimed(instrumentId)) {
150
150
  return {};
151
151
  }
152
- return instrumentId in this.claims ? this.claims[instrumentId] : {};
152
+ return instrumentId in this.claims ? this.claims[instrumentId] || {} : {};
153
153
  }
154
154
  getPlayersByInstrumentClaimed(instrumentId, onlyNoNotified = false) {
155
155
  const claimsByInstrument = this.claimsByInstrument(instrumentId);
@@ -165,7 +165,7 @@ class GroupRepertory extends basic_1.default {
165
165
  if (!this.isInstrumentClaimed(instrumentId)) {
166
166
  return false;
167
167
  }
168
- return userId in this.claims[instrumentId];
168
+ return userId in (this.claims[instrumentId] || {});
169
169
  }
170
170
  /** @deprecated use sections */
171
171
  getInstrument(id) {
@@ -76,7 +76,7 @@ export interface GroupRepertoryData extends ThemeBasicData {
76
76
  editedAt: Timestamp | null;
77
77
  visibility: GroupRepertoireVisibility;
78
78
  lastEventDatetime: Timestamp | null;
79
- claims: Record<InstrumentId, Record<UserId, GroupRepertoryClaimType>>;
79
+ claims: Partial<Record<InstrumentId, Record<UserId, GroupRepertoryClaimType>>>;
80
80
  clonedFrom: DocumentReference | null;
81
81
  readonly owner: DocumentReference;
82
82
  readonly createdAt: Timestamp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",