{"action":"created","issue":{"url":"https://api.github.com/repos/vartan/robin-grow/issues/33","repository_url":"https://api.github.com/repos/vartan/robin-grow","labels_url":"https://api.github.com/repos/vartan/robin-grow/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/vartan/robin-grow/issues/33/comments","events_url":"https://api.github.com/repos/vartan/robin-grow/issues/33/events","html_url":"https://github.com/vartan/robin-grow/issues/33","id":145316520,"number":33,"title":"Handle reddit downtime","user":{"login":"dkisselev","id":945848,"avatar_url":"https://avatars.githubusercontent.com/u/945848?v=3","gravatar_id":"","url":"https://api.github.com/users/dkisselev","html_url":"https://github.com/dkisselev","followers_url":"https://api.github.com/users/dkisselev/followers","following_url":"https://api.github.com/users/dkisselev/following{/other_user}","gists_url":"https://api.github.com/users/dkisselev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkisselev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkisselev/subscriptions","organizations_url":"https://api.github.com/users/dkisselev/orgs","repos_url":"https://api.github.com/users/dkisselev/repos","events_url":"https://api.github.com/users/dkisselev/events{/privacy}","received_events_url":"https://api.github.com/users/dkisselev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-02T00:26:52Z","updated_at":"2016-04-02T00:30:32Z","closed_at":null,"body":"Other scripts look to be just configuring a page refresh on some interval. Otherwise a few seconds of reddit downtime take you away from the robin page, which leads to abondonment.\r\n\r\n```\r\nsetTimeout(function(){\r\n        window.location.reload();\r\n    }, 300000);\r\n```\r\n\r\nis what I've seen others do, we might be able to come up with a more elegant solution"},"comment":{"url":"https://api.github.com/repos/vartan/robin-grow/issues/comments/204616835","html_url":"https://github.com/vartan/robin-grow/issues/33#issuecomment-204616835","issue_url":"https://api.github.com/repos/vartan/robin-grow/issues/33","id":204616835,"user":{"login":"vartan","id":3300248,"avatar_url":"https://avatars.githubusercontent.com/u/3300248?v=3","gravatar_id":"","url":"https://api.github.com/users/vartan","html_url":"https://github.com/vartan","followers_url":"https://api.github.com/users/vartan/followers","following_url":"https://api.github.com/users/vartan/following{/other_user}","gists_url":"https://api.github.com/users/vartan/gists{/gist_id}","starred_url":"https://api.github.com/users/vartan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vartan/subscriptions","organizations_url":"https://api.github.com/users/vartan/orgs","repos_url":"https://api.github.com/users/vartan/repos","events_url":"https://api.github.com/users/vartan/events{/privacy}","received_events_url":"https://api.github.com/users/vartan/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T00:30:32Z","updated_at":"2016-04-02T00:30:32Z","body":"Right now we have this for refreshing\r\n\r\n    var lastChatString = $(\".robin-message--timestamp\").last().attr(\"datetime\");\r\n    var timeSinceLastChat = new Date() - (new Date(lastChatString));\r\n    var now = new Date();\r\n    if(timeSinceLastChat !== undefined && (timeSinceLastChat > 60000 && now-timeStarted > 60000)) {\r\n\r\nit seems like something like this might work, but i can't really test it\r\n\r\n    var timestampExists = $(\".robin-message--timestamp\") !== undefined;\r\n    var lastChatString = $(\".robin-message--timestamp\").last().attr(\"datetime\");\r\n    var lastTime = (new Date(lastChatString));\r\n    var timeSinceLastChat = new Date() - lastTime;\r\n    var now = new Date();\r\n\r\n    if(timeSinceLastChat !== undefined && (timeSinceLastChat > 60000 && now-timeStarted > 60000)\r\n        || (now-timeStarted > 10000 && !timeStampExists)) {\r\n"}}