aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/group-page.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
index 7d13260..466af53 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
@@ -392,6 +392,16 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs,
if (cancelled) return;
applyIndexDelta(msg);
};
+ // A pushed message that will not open under the group key ends the
+ // session (transport.js _failSession). Nothing is waiting on a push, so
+ // without this the page would keep showing a stale index with nothing
+ // wrong on screen — the worst of the three failure shapes.
+ transport.onSessionFailed = (err) => {
+ if (cancelled) return;
+ setError(err.message);
+ setStatus('error');
+ if (onPresence) onPresence(groupId, 'online');
+ };
// We are in: an invitation to this group has served its purpose.
if (onJoined) onJoined(groupId);