graceful-updater 1.0.8 → 1.0.9

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.
@@ -37,7 +37,7 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
37
37
  }
38
38
  const _logger = { ...logger };
39
39
  const _wrap = (message, args, callback) => {
40
- callback(`[ElectronUpdator][${this.startUuid}]#${message}`, ...args);
40
+ callback(`[ElectronUpdator][${this.startUuid}][${this.state}]#${message}`, ...args);
41
41
  };
42
42
  _logger.error = (message, ...args) => {
43
43
  _wrap(message, args, logger.error);
@@ -69,8 +69,8 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
69
69
  this.setState(constants_1.StateType.CheckingForUpdate);
70
70
  this.emit(constants_1.EventType.CHECKING_FOR_UPDATE);
71
71
  const updateInfoResponse = await (0, utils_1.requestUpdateInfo)(this.options);
72
- this.updateInfo = (this.options?.updateInfoFormatter ? this.options?.updateInfoFormatter(updateInfoResponse) : updateInfoResponse);
73
- const ifNeedUpdate = this.options?.ifNeedUpdate(updateInfoResponse);
72
+ this.updateInfo = (this.options?.updateInfoFormatter ? (await this.options?.updateInfoFormatter(updateInfoResponse)) : updateInfoResponse);
73
+ const ifNeedUpdate = await this.options?.ifNeedUpdate(updateInfoResponse);
74
74
  if (!ifNeedUpdate) {
75
75
  this.logger.info(`checkForUpdates:updateInfo is ${JSON.stringify(this.updateInfo)},ifNeedUpdate is false`);
76
76
  this.emit(constants_1.EventType.UPDATE_NOT_AVAILABLE, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graceful-updater",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "graceful-updater is a software updator management solution for Electron applications, It is convenient to complete full software update and dynamic update.",
5
5
  "scripts": {
6
6
  "build": "sh ./build.sh",