From 5d702abdc5cfc95180d2378f5de4a38fa1e341a0 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 8 Sep 2015 21:53:33 +0200 Subject: [PATCH] Added support for partial stream responses (by totally ignoring them). --- lsp/mist.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lsp/mist.js b/lsp/mist.js index 7e925dbc..cf6ea076 100644 --- a/lsp/mist.js +++ b/lsp/mist.js @@ -3900,14 +3900,18 @@ var mist = { delete mist.user.loggedin; switch (d.authorize.status) { case 'OK': - //communication succesfull + //communication succesful, copy everything we care about, if it exists + if (d.config){mist.data.config = d.config;} + if (d.capabilities){mist.data.capabilities = d.capabilities;} + if (d.ui_settings){mist.data.ui_settings = d.ui_settings;} + if (d.LTS){mist.data.LTS = d.LTS;} + if (d.active_streams){mist.data.active_streams = d.active_streams;} + if (d.browse){mist.data.browse = d.browse;} + if (d.log){mist.data.log = d.log;} + if (d.streams && !d.streams["incomplete list"]){mist.data.streams = d.streams;} - $.extend(true,mist.data,d); - - //if streams/protocols have been deleted by someone else, make sure they're gone by overwriting - mist.data.streams = d.streams; - mist.data.config.protocols = d.config.protocols; - mist.data.config.limits = d.config.limits + //does this really belong globally stored here? + if (d.totals){mist.data.totals = d.totals;} mist.user.loggedin = true; UI.elements.connection.status.text('Connected').removeClass('red').addClass('green'); @@ -4242,4 +4246,4 @@ $.fn.setval = function(val){ } $(this).trigger('change'); return $(this); -} \ No newline at end of file +}