Use all WebSocket.close args for WIN platforms. (#16)
This commit is contained in:
Родитель
68f15f4a13
Коммит
bffa7456a7
|
@ -224,7 +224,7 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
|
|||
}
|
||||
|
||||
_close(code?: number, reason?: string): void {
|
||||
if (Platform.OS === 'android') {
|
||||
if (Platform.OS === 'android' || Platform.OS === 'win32' || Platform.OS == 'windesktop') {
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
|
||||
const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;
|
||||
const closeReason = typeof reason === 'string' ? reason : '';
|
||||
|
|
Загрузка…
Ссылка в новой задаче