Preventing urlvars of null breaking connection; Acceping test_mode=1 in URL
This commit is contained in:
@ -111,7 +111,8 @@
|
||||
var css = document.createElement("link");
|
||||
css.rel = "stylesheet";
|
||||
|
||||
// Check for test mode. This is toggled under Settings > Debug > Test mode
|
||||
// Check for test mode. This is toggled under Settings > Debug > Test mode or can
|
||||
// be manually triggered with the URL var "?test_mode=1"
|
||||
try {
|
||||
var ui = JSON.parse(localStorage.getItem('ui') );
|
||||
var test_mode = (
|
||||
@ -119,22 +120,23 @@
|
||||
&& ui
|
||||
&& typeof(ui.test_mode) !== 'undefined'
|
||||
&& ui.test_mode
|
||||
);
|
||||
) || window.location.href.indexOf('test_mode=1') > -1;
|
||||
} catch(error){
|
||||
console.error(error);
|
||||
var test_mode = false;
|
||||
}
|
||||
|
||||
// Test mode, use un-minified code
|
||||
if (test_mode){
|
||||
css.href = '/iris/app.css?v='+build;
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
if (test_mode){
|
||||
console.debug("Test mode enabled, using un-minified code");
|
||||
css.href = '/iris/app.css?v='+build;
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
|
||||
// Production-grade, minified app
|
||||
} else {
|
||||
css.href = '/iris/app.min.css?v='+build;
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
}
|
||||
// Production-grade, minified app
|
||||
} else {
|
||||
css.href = '/iris/app.min.css?v='+build;
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
}
|
||||
|
||||
// And finally inject our CSS/JS tags
|
||||
document.body.appendChild(css);
|
||||
|
||||
@ -41,8 +41,9 @@ class InitialSetup extends React.Component {
|
||||
// Check for url-parsed configuration values
|
||||
const customHost = helpers.queryString('host', search);
|
||||
const customPort = helpers.queryString('port', search);
|
||||
if (customHost) this.setState({ host: customHost });
|
||||
if (customPort) this.setState({ port: customPort });
|
||||
|
||||
this.setState({ host: customHost, port: customPort });
|
||||
uiActions.setWindowTitle('Welcome to Iris');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user