()
| 235 | } |
| 236 | |
| 237 | export function refreshWebSocketConnectionPreference() { |
| 238 | shouldMaintainWs = hasConfiguredWebAuth(); |
| 239 | |
| 240 | if (shouldMaintainWs) { |
| 241 | void ensureBackgroundWsConnection(); |
| 242 | return; |
| 243 | } |
| 244 | |
| 245 | clearReconnectTimer(); |
| 246 | if (ws && ws.readyState === WebSocket.OPEN) { |
| 247 | ws.close(); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | async function getOrCreateWs(options = {}) { |
| 252 | const { background = false } = options; |
no test coverage detected