check for the presence of a blockHash in localStorage when logging in

This commit is contained in:
ansuz
2018-06-20 14:27:44 +02:00
parent 3ba0ad3cf1
commit d03339f20b
7 changed files with 157 additions and 14 deletions

View File

@@ -137,17 +137,15 @@ define([], function () {
else if (bytes >= oneMegabyte) { return 'MB'; }
};
// given a path, asynchronously return an arraybuffer
Util.fetch = function (src, cb) {
var done = false;
var CB = function (err, res) {
if (done) { return; }
done = true;
cb(err, res);
};
var CB = Util.once(cb);
var xhr = new XMLHttpRequest();
xhr.open("GET", src, true);
xhr.responseType = "arraybuffer";
xhr.onerror = function (err) { CB(err); };
xhr.onload = function () {
if (/^4/.test(''+this.status)) {
return CB('XHR_ERROR');