fix: use 1000 as websocket close code (#219)

Firefox throws a `DOMException` when using `1001` as close code: `A parameter or an operation is not supported by the underlying object`.
Cannot really find out why this is, but in this case it does not really matter, as the code only runs if there is no connection in the first place.
This commit is contained in:
Thebora Kompanioni 2022-04-15 12:18:47 +02:00 committed by GitHub
parent 825f725053
commit 6e3ebf019b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,7 @@ const WebsocketProvider = ({ children }) => {
needsForceClose
)
if (needsForceClose) {
websocket.close(1001, 'Force-close pending connection')
websocket.close(1000, 'Force-close pending connection')
}
}, WEBSOCKET_ESTABLISH_CONNECTION_MAX_DURATION)