Skip to content

Commit

Permalink
Merge pull request #87 from snow-actions/close-if-connected
Browse files Browse the repository at this point in the history
Close if connected
  • Loading branch information
SnowCait authored Sep 11, 2023
2 parents 4a95664 + 6b91c79 commit 22a8048
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions nostr.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module.exports.publishEvent = (relays, event) => {
clearTimeout(timeoutId);
}
for (const ws of wss) {
if (ws.readyState === WebSocket.CLOSED) {
continue;
}
ws.close();
}
for (const [url, json] of messages) {
Expand Down

0 comments on commit 22a8048

Please sign in to comment.