Skip to content

Commit

Permalink
Checking for empty host values. Addresses #633
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsielicki committed Sep 1, 2016
1 parent dbc7eaf commit 542f316
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions web-server/js/slycat-remote-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,31 @@ define("slycat-remote-controls", ["slycat-server-root", "slycat-web-client", "kn
localStorage.setItem("slycat-remote-controls-hostname", value);
component.status(null);

client.get_remotes({
hostname: value,
success: function(result)
{
if(component.hostname() == value)
if(value != null && value.trim() != "")
{
client.get_remotes({
hostname: value,
success: function(result)
{
if(component.hostname() == value)
{
if(result.status)
component.session_exists(true);
else
component.session_exists(false);
}
},
error: function(request, status, reason_phrase)
{
if(result.status)
component.session_exists(true);
else
if(component.hostname() == value)
component.session_exists(false);
}
},
error: function(request, status, reason_phrase)
{
if(component.hostname() == value)
component.session_exists(false);
}
});
});
}
else
{
component.session_exists(false);
}
});

component.username.subscribe(function(value)
Expand Down

0 comments on commit 542f316

Please sign in to comment.