From 4e5f8fcb995cf52eb6ef98503a8196f067825c8a Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 19 Feb 2021 15:01:52 +0100 Subject: [PATCH] Fix drive stuck offline --- www/common/outer/team.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 0ef5c4763..15a1b56e6 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -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(); } var proxy = lm.proxy; var team = { @@ -493,7 +494,7 @@ define([ ctx.updateProgress({ progress: ctx.progress }); - onCacheReady(ctx, id, lm, roster, keys, null, cb); + onCacheReady(ctx, id, lm, roster, keys, null, waitFor(cb)); this.check = function () {}; } }; @@ -1905,6 +1906,7 @@ define([ openChannel(ctx, teams[id], id, waitFor(function (err) { if (err) { delete ctx.onReadyHandlers[id]; + delete ctx.cache[id]; var txt = typeof(err) === "string" ? err : (err.type || err.message); Feedback.send("TEAM_LOADING_ERROR="+txt); return void console.error(err);