@hkdigital/lib-core 0.5.60 → 0.5.62

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.
@@ -288,19 +288,29 @@ export class PresenterState {
288
288
  throw new Error('Not configured yet');
289
289
  }
290
290
 
291
- if (slide.name === this.currentSlideName) {
292
- //throw new Error(`gotoSlide cannot transition to current slide`);
293
- console.error(`gotoSlide cannot transition to current slide`);
291
+ // Can't transition if we're already transitioning to this slide
292
+ if (slide.name === this.nextSlideName) {
293
+ console.debug(`gotoSlide already transitioning to slide [${slide.name}]`);
294
+ // Clear any pending slide since we're already going where the user wants
295
+ this.pendingSlideName = null;
294
296
  return;
295
297
  }
296
298
 
297
- this.nextSlideName = slide.name;
299
+ // Can't transition if we're idle and already on this slide
300
+ if (slide.name === this.currentSlideName && !this.busy) {
301
+ console.debug(`gotoSlide cannot transition to current slide [${slide.name}]`);
302
+ return;
303
+ }
298
304
 
305
+ // If busy, queue this slide for later without modifying nextSlideName
299
306
  if (this.busy) {
300
307
  this.pendingSlideName = slide.name;
301
308
  return;
302
309
  }
303
310
 
311
+ // Now we're actually starting a new transition
312
+ this.nextSlideName = slide.name;
313
+
304
314
  this.#callOnBeforeListeners();
305
315
 
306
316
  this.slideLoadingPromise = null;
@@ -412,8 +422,6 @@ export class PresenterState {
412
422
  // Check if there's a pending slide transition
413
423
  if (this.pendingSlideName) {
414
424
  const pendingName = this.pendingSlideName;
415
-
416
- this.nextSlideName = pendingName;
417
425
  this.pendingSlideName = null;
418
426
 
419
427
  untrack(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.60",
3
+ "version": "0.5.62",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"