attempt a ping on initiation, reload the page if fail. may put this elsewhere and...
authorOwen Smith <owen@omsmith.ca>
Mon, 19 Nov 2012 06:16:35 +0000 (01:16 -0500)
committerOwen Smith <owen@omsmith.ca>
Mon, 19 Nov 2012 06:16:35 +0000 (01:16 -0500)
www/assets/js/client.js

index bbdc4db..ac2f54c 100644 (file)
@@ -4,6 +4,12 @@ PosClientWrapper = function (authKey, serverLocation) {
        this._transport = new Thrift.Transport(serverLocation);
        this._protocol = new Thrift.Protocol(this._transport);
        this._client = new PosClient(this._protocol);
+
+       try {
+               this._client.ping();
+       } catch (e) {
+               location.reload(true);
+       }
 };
 
 PosClientWrapper.prototype = {};