@netless/app-slide 0.2.63 → 0.2.64

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/app-slide",
3
- "version": "0.2.63",
3
+ "version": "0.2.64",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "README-zh.md"
11
11
  ],
12
12
  "devDependencies": {
13
- "@netless/slide": "^1.4.12",
13
+ "@netless/slide": "^1.4.18",
14
14
  "@types/color-string": "^1.5.2",
15
15
  "color-string": "^1.9.1",
16
16
  "jspdf": "2.5.1",
@@ -120,11 +120,11 @@ export class SlideController {
120
120
  }
121
121
 
122
122
  public ready = false;
123
- private resolveReady!: () => void;
123
+ private resolveReady!: (index: number) => void;
124
124
  public readonly readyPromise = new Promise<void>(resolve => {
125
- this.resolveReady = () => {
125
+ this.resolveReady = (slideIndex) => {
126
126
  if (this.ready) {
127
- log("[Slide] render end");
127
+ log("[Slide] render end", slideIndex);
128
128
  } else {
129
129
  setTimeout(() => {
130
130
  this.ready = true;
@@ -370,16 +370,20 @@ export class SlideController {
370
370
  if (!this.visible) return;
371
371
  this.isFrozen = false;
372
372
  if (this.ready) {
373
+ let isNeedSyncState = false;
373
374
  log("[Slide] unfreeze", this.context.appId);
374
- if (this.invisibleBehavior === "frozen") {
375
+ if (this.invisibleBehavior === "frozen" && !this.slide.view) {
375
376
  this.slide.release();
377
+ isNeedSyncState = true;
376
378
  } else {
377
379
  this.slide.resume();
378
380
  }
379
- const currentSlideIndex = this.context.storage.state.state?.currentSlideIndex;
380
- if (currentSlideIndex) {
381
- log("[Slide] sync storage", currentSlideIndex);
382
- this.slide.setSlideState({ currentSlideIndex });
381
+ if (isNeedSyncState) {
382
+ const currentSlideIndex = this.context.storage.state.state?.currentSlideIndex;
383
+ if (currentSlideIndex) {
384
+ log("[Slide] sync storage", currentSlideIndex);
385
+ this.slide.setSlideState({ currentSlideIndex });
386
+ }
383
387
  }
384
388
  } else {
385
389
  this._toFreeze = -1;