Use replaceState for /connect redirects

This commit is contained in:
khlieng 2015-05-05 00:46:12 +02:00
parent d440aac023
commit deba58dbff
4 changed files with 26 additions and 22 deletions

View File

@ -15,7 +15,7 @@ var routeActions = require('./actions/route');
var uuid = localStorage.uuid;
if (!uuid) {
routeActions.navigate('connect');
routeActions.navigate('connect', true);
localStorage.uuid = uuid = util.UUID();
}

View File

@ -13,8 +13,12 @@ var App = React.createClass({
Reflux.listenTo(routeActions.navigate, 'navigate')
],
navigate: function(path) {
this.transitionTo(path);
navigate: function(path, replace) {
if (!replace) {
this.transitionTo(path);
} else {
this.replaceWith(path);
}
},
render: function() {

View File

@ -75,7 +75,7 @@ socket.on('servers', function(data) {
window.loaded = true;
if (data === null) {
routeActions.navigate('connect');
routeActions.navigate('connect', true);
}
serverActions.load(data);

File diff suppressed because one or more lines are too long