GUACAMOLE-204: If is not a function; fix style around location redirect

This commit is contained in:
Nick Couchman
2017-02-10 13:21:53 -05:00
committed by Nick Couchman
parent c591a58f93
commit 48baa5211e

View File

@@ -42,10 +42,10 @@ angular.module('index').config(['$routeProvider',
var curPath = window.location.href; var curPath = window.location.href;
var ticketPos = curPath.indexOf("?ticket=") + 8; var ticketPos = curPath.indexOf("?ticket=") + 8;
var hashPos = curPath.indexOf("#/"); var hashPos = curPath.indexOf("#/");
if(ticketPos > 0 && ticketPos < hashPos) { if (ticketPos > 0 && ticketPos < hashPos) {
var ticket = curPath.substring(ticketPos, hashPos); var ticket = curPath.substring(ticketPos, hashPos);
var newPath = curPath.substring(0,ticketPos - 8) + '#/?ticket=' + ticket; var newPath = curPath.substring(0,ticketPos - 8) + '#/?ticket=' + ticket;
window.location=newPath; window.location = newPath;
} }
}]); }]);