nav tabs on admin dashboard
This commit is contained in:
9
node_modules/webpack-dev-server/client/socket.js
generated
vendored
9
node_modules/webpack-dev-server/client/socket.js
generated
vendored
@@ -15,19 +15,17 @@ var socket = function initSocket(url, handlers) {
|
||||
sock.onclose = function onclose() {
|
||||
if (retries === 0) {
|
||||
handlers.close();
|
||||
}
|
||||
} // Try to reconnect.
|
||||
|
||||
// Try to reconnect.
|
||||
sock = null;
|
||||
|
||||
// After 10 retries stop trying, to prevent logspam.
|
||||
sock = null; // After 10 retries stop trying, to prevent logspam.
|
||||
|
||||
if (retries <= 10) {
|
||||
// Exponentially increase timeout to reconnect.
|
||||
// Respectfully copied from the package `got`.
|
||||
// eslint-disable-next-line no-mixed-operators, no-restricted-properties
|
||||
var retryInMs = 1000 * Math.pow(2, retries) + Math.random() * 100;
|
||||
retries += 1;
|
||||
|
||||
setTimeout(function () {
|
||||
socket(url, handlers);
|
||||
}, retryInMs);
|
||||
@@ -37,6 +35,7 @@ var socket = function initSocket(url, handlers) {
|
||||
sock.onmessage = function onmessage(e) {
|
||||
// This assumes that all data sent via the websocket is JSON.
|
||||
var msg = JSON.parse(e.data);
|
||||
|
||||
if (handlers[msg.type]) {
|
||||
handlers[msg.type](msg.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user