Use replaceState for /connect redirects
This commit is contained in:
parent
d440aac023
commit
deba58dbff
4 changed files with 26 additions and 22 deletions
|
@ -15,7 +15,7 @@ var routeActions = require('./actions/route');
|
||||||
|
|
||||||
var uuid = localStorage.uuid;
|
var uuid = localStorage.uuid;
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
routeActions.navigate('connect');
|
routeActions.navigate('connect', true);
|
||||||
localStorage.uuid = uuid = util.UUID();
|
localStorage.uuid = uuid = util.UUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,12 @@ var App = React.createClass({
|
||||||
Reflux.listenTo(routeActions.navigate, 'navigate')
|
Reflux.listenTo(routeActions.navigate, 'navigate')
|
||||||
],
|
],
|
||||||
|
|
||||||
navigate: function(path) {
|
navigate: function(path, replace) {
|
||||||
|
if (!replace) {
|
||||||
this.transitionTo(path);
|
this.transitionTo(path);
|
||||||
|
} else {
|
||||||
|
this.replaceWith(path);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
|
@ -75,7 +75,7 @@ socket.on('servers', function(data) {
|
||||||
window.loaded = true;
|
window.loaded = true;
|
||||||
|
|
||||||
if (data === null) {
|
if (data === null) {
|
||||||
routeActions.navigate('connect');
|
routeActions.navigate('connect', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
serverActions.load(data);
|
serverActions.load(data);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue