From 98edd3939bb00efd16f4be3bd26e6a25a87f04ca Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 27 Jul 2015 18:50:55 -0700 Subject: [PATCH] Fix up websocket options handling --- js/libtextsecure.js | 5 ++++- libtextsecure/websocket.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index c127d9bd..4a1c648c 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38409,7 +38409,10 @@ axolotlInternal.RecipientRecord = function() { TextSecureWebSocket = function (url, opts) { 'use strict'; opts = opts || {}; - var reconnectTimeout = opts.reconnectTimeout || 1000; + var reconnectTimeout = 1000; + if (opts && opts.reconnectTimeout !== undefined) { + reconnectTimeout = opts.reconnectTimeout; + } var reconnectSemaphore = 0; var socket; var calledClose = false; diff --git a/libtextsecure/websocket.js b/libtextsecure/websocket.js index 49917c49..8dbb5442 100644 --- a/libtextsecure/websocket.js +++ b/libtextsecure/websocket.js @@ -25,7 +25,10 @@ TextSecureWebSocket = function (url, opts) { 'use strict'; opts = opts || {}; - var reconnectTimeout = opts.reconnectTimeout || 1000; + var reconnectTimeout = 1000; + if (opts && opts.reconnectTimeout !== undefined) { + reconnectTimeout = opts.reconnectTimeout; + } var reconnectSemaphore = 0; var socket; var calledClose = false;