Skip to content

Commit 1e6a9f9

Browse files
committed
1 parent 765dbca commit 1e6a9f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tgui/packages/tgui-panel/websocket.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ export const websocketMiddleware = (store) => {
8484
websocketServer: string;
8585
};
8686
};
87+
if (!payload) return next(action);
8788
if (type === updateSettings.type || type === loadSettings.type) {
89+
if (typeof payload?.websocketEnabled === 'undefined') {
90+
store.dispatch(
91+
updateSettings({
92+
websocketEnabled: false,
93+
}),
94+
);
95+
return next(action);
96+
}
8897
if (!payload.websocketEnabled) {
8998
websocket?.close(WEBSOCKET_DISABLED);
9099
websocket = null;

0 commit comments

Comments
 (0)