diff --git a/packages/nocap/package.json b/packages/nocap/package.json index f7c0fbfa..afbed34e 100644 --- a/packages/nocap/package.json +++ b/packages/nocap/package.json @@ -1,6 +1,6 @@ { "name": "@nostrwatch/nocap", - "version": "0.4.1", + "version": "0.4.2", "main": "src/index.js", "type": "module", "license": "MIT", diff --git a/packages/nocap/src/classes/Base.js b/packages/nocap/src/classes/Base.js index bbf96202..1eebee86 100644 --- a/packages/nocap/src/classes/Base.js +++ b/packages/nocap/src/classes/Base.js @@ -517,7 +517,7 @@ export default class Base { 'close', () => this.ws.close() ) - if(this.hard_fail) return this.terminate(key) + if(this.hard_fail || this.config.websocketAlwaysTerminate === true) return this.terminate(key) } /** diff --git a/packages/nocap/src/interfaces/ConfigInterface.js b/packages/nocap/src/interfaces/ConfigInterface.js index ccf5426f..789277b2 100644 --- a/packages/nocap/src/interfaces/ConfigInterface.js +++ b/packages/nocap/src/interfaces/ConfigInterface.js @@ -23,7 +23,8 @@ export const ConfigDefaults = { autoDepsIgnoredInResult: true, removeFromResult: [], failAllChecksOnConnectFailure: true, - rejectOnConnectFailure: false + rejectOnConnectFailure: false, + websocketAlwaysTerminate: true } /**