Permalink
Browse files

force reload when server is reset.

  • Loading branch information...
1 parent a301477 commit 0dccb0a2cbf1169f85b1abad8064ea497be9c973 Default Username committed with root Mar 30, 2012
Showing with 10 additions and 3 deletions.
  1. +3 −3 app.js
  2. +7 −0 public/index.js
View
6 app.js
@@ -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);
View
7 public/index.js
@@ -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);

0 comments on commit 0dccb0a

Please sign in to comment.