@noxfly/noxus 1.1.5 → 1.1.7

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/dist/noxus.js CHANGED
@@ -1035,6 +1035,9 @@ var _Router = class _Router {
1035
1035
  }
1036
1036
  const action = controllerInstance[routeDef.handler];
1037
1037
  response.body = await action.call(controllerInstance, request, response);
1038
+ if (response.body === void 0) {
1039
+ response.body = {};
1040
+ }
1038
1041
  }, "dispatch");
1039
1042
  await dispatch(0);
1040
1043
  }
@@ -1229,7 +1232,8 @@ var _NoxApp = class _NoxApp {
1229
1232
  this.shutdownChannel(senderId);
1230
1233
  });
1231
1234
  this.messagePorts.clear();
1232
- this.app?.dispose();
1235
+ Logger.info("All windows closed, shutting down application...");
1236
+ await this.app?.dispose();
1233
1237
  if (process.platform !== "darwin") {
1234
1238
  import_main.app.quit();
1235
1239
  }
package/dist/noxus.mjs CHANGED
@@ -958,6 +958,9 @@ var _Router = class _Router {
958
958
  }
959
959
  const action = controllerInstance[routeDef.handler];
960
960
  response.body = await action.call(controllerInstance, request, response);
961
+ if (response.body === void 0) {
962
+ response.body = {};
963
+ }
961
964
  }, "dispatch");
962
965
  await dispatch(0);
963
966
  }
@@ -1152,7 +1155,8 @@ var _NoxApp = class _NoxApp {
1152
1155
  this.shutdownChannel(senderId);
1153
1156
  });
1154
1157
  this.messagePorts.clear();
1155
- this.app?.dispose();
1158
+ Logger.info("All windows closed, shutting down application...");
1159
+ await this.app?.dispose();
1156
1160
  if (process.platform !== "darwin") {
1157
1161
  app.quit();
1158
1162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noxfly/noxus",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "main": "dist/noxus.js",
5
5
  "types": "dist/noxus.d.ts",
6
6
  "scripts": {
package/src/app.ts CHANGED
@@ -147,7 +147,8 @@ export class NoxApp {
147
147
 
148
148
  this.messagePorts.clear();
149
149
 
150
- this.app?.dispose();
150
+ Logger.info('All windows closed, shutting down application...');
151
+ await this.app?.dispose();
151
152
 
152
153
  if(process.platform !== 'darwin') {
153
154
  app.quit();
package/src/router.ts CHANGED
@@ -264,6 +264,11 @@ export class Router {
264
264
  // endpoint action
265
265
  const action = controllerInstance[routeDef.handler] as ControllerAction;
266
266
  response.body = await action.call(controllerInstance, request, response);
267
+
268
+ // avoid parsing error on the renderer if the action just does treatment without returning anything
269
+ if(response.body === undefined) {
270
+ response.body = {};
271
+ }
267
272
  };
268
273
 
269
274
  await dispatch(0);