@sprucelabs/spruce-calendar-components 22.6.18 → 22.6.19

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.
@@ -4,8 +4,10 @@ import SpyRemoteEventStore from './SpyRemoteEventStore';
4
4
  import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
5
5
  export default class SpyEventManager extends CalendarEventManager {
6
6
  updateContext?: UpdateCalendarToolBeltContextHandler<CalendarToolBeltContext>;
7
+ getShouldIgnoreNextContextUpdate(): boolean;
7
8
  constructor(options: SpyEventManagerOptions);
8
9
  getRemoteEventsStore(): SpyRemoteEventStore;
10
+ getStateMachine(): import("../../types/calendar.types").CalendarToolBeltStateMachine<CalendarToolBeltContext>;
9
11
  getPreferences(): SpyRemotePreferencesStore;
10
12
  silentlySetAllEvents(events: CalendarEvent[]): void;
11
13
  silentlyMixinEvents(events: CalendarEvent[]): void;
@@ -8,9 +8,15 @@ class SpyEventManager extends CalendarEventManager_1.default {
8
8
  constructor(options) {
9
9
  super(options);
10
10
  }
11
+ getShouldIgnoreNextContextUpdate() {
12
+ return this.shouldIgnoreNextContextUpdate;
13
+ }
11
14
  getRemoteEventsStore() {
12
15
  return this.events;
13
16
  }
17
+ getStateMachine() {
18
+ return this.sm;
19
+ }
14
20
  getPreferences() {
15
21
  return this.prefs;
16
22
  }
@@ -4,8 +4,10 @@ import SpyRemoteEventStore from './SpyRemoteEventStore';
4
4
  import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
5
5
  export default class SpyEventManager extends CalendarEventManager {
6
6
  updateContext?: UpdateCalendarToolBeltContextHandler<CalendarToolBeltContext>;
7
+ getShouldIgnoreNextContextUpdate(): boolean;
7
8
  constructor(options: SpyEventManagerOptions);
8
9
  getRemoteEventsStore(): SpyRemoteEventStore;
10
+ getStateMachine(): import("../../types/calendar.types").CalendarToolBeltStateMachine<CalendarToolBeltContext>;
9
11
  getPreferences(): SpyRemotePreferencesStore;
10
12
  silentlySetAllEvents(events: CalendarEvent[]): void;
11
13
  silentlyMixinEvents(events: CalendarEvent[]): void;
@@ -12,9 +12,15 @@ export default class SpyEventManager extends CalendarEventManager {
12
12
  constructor(options) {
13
13
  super(options);
14
14
  }
15
+ getShouldIgnoreNextContextUpdate() {
16
+ return this.shouldIgnoreNextContextUpdate;
17
+ }
15
18
  getRemoteEventsStore() {
16
19
  return this.events;
17
20
  }
21
+ getStateMachine() {
22
+ return this.sm;
23
+ }
18
24
  getPreferences() {
19
25
  return this.prefs;
20
26
  }
@@ -13,8 +13,8 @@ export default class CalendarEventManager {
13
13
  private eventTypes?;
14
14
  private remoteVc;
15
15
  private hasVcForEventTypeBeenLoaded;
16
- private sm;
17
- private shouldIgnoreNextContextUpdate;
16
+ protected sm: CalendarToolBeltStateMachine<CalendarToolBeltContext>;
17
+ protected shouldIgnoreNextContextUpdate: boolean;
18
18
  private askForUpdateStrategy;
19
19
  private dateToUpdate?;
20
20
  private shouldUpdateAllEventsGoingForward?;
@@ -194,7 +194,9 @@ export default class CalendarEventManager {
194
194
  if (this.shouldUpdateContextOnNextSave &&
195
195
  ((_a = this.sm.getContext().event) === null || _a === void 0 ? void 0 : _a.id) === id) {
196
196
  this.shouldIgnoreNextContextUpdate = true;
197
- void this.updateEventInContext(rest);
197
+ void this.updateEventInContext(rest).then(() => {
198
+ this.shouldIgnoreNextContextUpdate = false;
199
+ });
198
200
  }
199
201
  this.shouldUpdateContextOnNextSave = true;
200
202
  }
@@ -331,6 +333,7 @@ export default class CalendarEventManager {
331
333
  handleDidUpdateContext() {
332
334
  return __awaiter(this, void 0, void 0, function* () {
333
335
  if (this.shouldIgnoreNextContextUpdate) {
336
+ console.log('setting should ignore back to false', this.shouldIgnoreNextContextUpdate);
334
337
  this.shouldIgnoreNextContextUpdate = false;
335
338
  return;
336
339
  }
@@ -13,8 +13,8 @@ export default class CalendarEventManager {
13
13
  private eventTypes?;
14
14
  private remoteVc;
15
15
  private hasVcForEventTypeBeenLoaded;
16
- private sm;
17
- private shouldIgnoreNextContextUpdate;
16
+ protected sm: CalendarToolBeltStateMachine<CalendarToolBeltContext>;
17
+ protected shouldIgnoreNextContextUpdate: boolean;
18
18
  private askForUpdateStrategy;
19
19
  private dateToUpdate?;
20
20
  private shouldUpdateAllEventsGoingForward?;
@@ -174,7 +174,9 @@ class CalendarEventManager {
174
174
  if (this.shouldUpdateContextOnNextSave &&
175
175
  ((_a = this.sm.getContext().event) === null || _a === void 0 ? void 0 : _a.id) === id) {
176
176
  this.shouldIgnoreNextContextUpdate = true;
177
- void this.updateEventInContext(rest);
177
+ void this.updateEventInContext(rest).then(() => {
178
+ this.shouldIgnoreNextContextUpdate = false;
179
+ });
178
180
  }
179
181
  this.shouldUpdateContextOnNextSave = true;
180
182
  }
@@ -290,6 +292,7 @@ class CalendarEventManager {
290
292
  }
291
293
  async handleDidUpdateContext() {
292
294
  if (this.shouldIgnoreNextContextUpdate) {
295
+ console.log('setting should ignore back to false', this.shouldIgnoreNextContextUpdate);
293
296
  this.shouldIgnoreNextContextUpdate = false;
294
297
  return;
295
298
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-calendar-components",
3
3
  "description": "Calendar components for working with calendars and Sprucebot.",
4
- "version": "22.6.18",
4
+ "version": "22.6.19",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },