Fix drive stuck offline

pull/1/head
yflory 4 years ago
parent 7459e17e91
commit 4e5f8fcb99

@ -189,7 +189,8 @@ define([
}); });
}; };
var onCacheReady = function (ctx, id, lm, roster, keys, cId, cb) { var onCacheReady = function (ctx, id, lm, roster, keys, cId, _cb) {
var cb = Util.once(Util.mkAsync(_cb));
if (ctx.cache[id]) { return void cb(); } if (ctx.cache[id]) { return void cb(); }
var proxy = lm.proxy; var proxy = lm.proxy;
var team = { var team = {
@ -493,7 +494,7 @@ define([
ctx.updateProgress({ ctx.updateProgress({
progress: ctx.progress progress: ctx.progress
}); });
onCacheReady(ctx, id, lm, roster, keys, null, cb); onCacheReady(ctx, id, lm, roster, keys, null, waitFor(cb));
this.check = function () {}; this.check = function () {};
} }
}; };
@ -1905,6 +1906,7 @@ define([
openChannel(ctx, teams[id], id, waitFor(function (err) { openChannel(ctx, teams[id], id, waitFor(function (err) {
if (err) { if (err) {
delete ctx.onReadyHandlers[id]; delete ctx.onReadyHandlers[id];
delete ctx.cache[id];
var txt = typeof(err) === "string" ? err : (err.type || err.message); var txt = typeof(err) === "string" ? err : (err.type || err.message);
Feedback.send("TEAM_LOADING_ERROR="+txt); Feedback.send("TEAM_LOADING_ERROR="+txt);
return void console.error(err); return void console.error(err);

Loading…
Cancel
Save