Skip to content

Commit

Permalink
force reload when server is reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
Default Username authored and root committed Mar 30, 2012
1 parent a301477 commit 0dccb0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.js
Expand Up @@ -20,9 +20,9 @@ var app = express.createServer();
var staticProvider = gzippo.staticGzip(__dirname + '/public'); // use GZIP compression for static files (cache ~1 day)!
app.use(staticProvider);
app.get('/',function(req,res,next){
res.send("unauthenticated");
})
app.get('/6fG8h72OeP1FcZ',function(req,res,next){
// res.send("unauthenticated");
//});
//app.get('/6fG8h72OeP1FcZ',function(req,res,next){
console.log(staticProvider);
req.url = "index.html";
staticProvider(req, res, next);
Expand Down
7 changes: 7 additions & 0 deletions public/index.js
Expand Up @@ -1361,8 +1361,15 @@ function getURLHashVariable(variable){
// ---------------------------------------------------------
// READY! :)
// ---------------------------------------------------------
var alreadyConnected = false;
now.ready(function(){
if(alreadyConnected){
// seeing ready after already being connected.. assume server was reset!
alert("server was reset.");
window.location.reload();
}
nowIsOnline = true;
alreadyConnected = true;
console.log("Using NowJS -- this clientId: " + now.core.clientId);
now.s_sendUserEvent("join"); // let everyone know who I am!
setInterval(ifOnlineLetCollaboratorsKnowImHere, TIME_UNTIL_GONE/3);
Expand Down

0 comments on commit 0dccb0a

Please sign in to comment.