@vielhuber/wahelper 1.8.3 → 1.8.4

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": "@vielhuber/wahelper",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Lightweight whatsapp integration layer.",
5
5
  "main": "wahelper.js",
6
6
  "files": [
@@ -274,7 +274,7 @@ export default class wahelperDaemon {
274
274
  this.log('storeDataToDatabase');
275
275
 
276
276
  let messages = Array.isArray(data?.messages) ? data.messages : [];
277
- let chats = Array.isArray(data?.chats) ? data.chats : [];
277
+ let chats = Array.isArray(data) ? data : Array.isArray(data?.chats) ? data.chats : [];
278
278
  if (messages.length === 0 && chats.length === 0) {
279
279
  return;
280
280
  }
@@ -1148,5 +1148,7 @@ export default class wahelperDaemon {
1148
1148
  }
1149
1149
  }
1150
1150
 
1151
- let daemon = new wahelperDaemon();
1152
- daemon.init();
1151
+ if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
1152
+ let daemon = new wahelperDaemon();
1153
+ daemon.init();
1154
+ }