mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:38:25 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -95,7 +95,9 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
let lastFrameId: string | undefined;
|
||||
|
||||
const setCloseCause = (cause: string, meta?: Record<string, unknown>) => {
|
||||
if (!closeCause) closeCause = cause;
|
||||
if (!closeCause) {
|
||||
closeCause = cause;
|
||||
}
|
||||
if (meta && Object.keys(meta).length > 0) {
|
||||
closeMeta = { ...closeMeta, ...meta };
|
||||
}
|
||||
@@ -125,10 +127,14 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
});
|
||||
|
||||
const close = (code = 1000, reason?: string) => {
|
||||
if (closed) return;
|
||||
if (closed) {
|
||||
return;
|
||||
}
|
||||
closed = true;
|
||||
clearTimeout(handshakeTimer);
|
||||
if (client) clients.delete(client);
|
||||
if (client) {
|
||||
clients.delete(client);
|
||||
}
|
||||
try {
|
||||
socket.close(code, reason);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user