@vnejs/plugins.save.continue 0.1.1 → 0.1.3

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/const/events.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export const SUBSCRIBE_EVENTS = {
2
2
  MAKE: "vne:save_continue:make",
3
+ LOAD: "vne:save_continue:load",
4
+ PRELOAD: "vne:save_continue:preload",
3
5
  };
@@ -6,28 +6,20 @@ export class SaveContinue extends Module {
6
6
  subscribe = () => {
7
7
  this.on(this.EVENTS.SAVE_CONTINUE.MAKE, this.onMake);
8
8
  this.on(this.EVENTS.SAVE_CONTINUE.LOAD, this.onLoad);
9
+ this.on(this.EVENTS.SAVE_CONTINUE.PRELOAD, this.onPreload);
9
10
  };
10
11
 
11
12
  init = async () => {
12
13
  const save = await this.emitOne(this.EVENTS.SAVE.GET, { key: this.name });
13
14
 
14
- this.shared.hasContinueSave = Boolean(save);
15
+ this.shared.hasContinueSave = save && save.migrateStatus === this.CONST.STATE.MIGRATE_STATUS.OK;
15
16
  };
16
17
 
17
18
  onMake = async () => {
18
- this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value: { action: "make start", index: this.index } });
19
-
20
19
  await this.emit(this.EVENTS.SAVE.CREATE, { key: this.name, withScreenshot: false });
21
20
 
22
21
  this.shared.hasContinueSave = true;
23
-
24
- this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value: { action: "make end", index: this.index } });
25
- };
26
- onLoad = async () => {
27
- this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value: { action: "load start", index: this.index } });
28
-
29
- await this.emit(this.EVENTS.SAVE.LOAD, { key: this.name });
30
-
31
- this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value: { action: "load end", index: this.index } });
32
22
  };
23
+ onLoad = () => this.emit(this.EVENTS.SAVE.LOAD, { key: this.name });
24
+ onPreload = () => this.emit(this.EVENTS.SAVE.PRELOAD, { key: this.name });
33
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.save.continue",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",