feat: keep live snapshots usable through refresh failures (#149)
This commit is contained in:
1 parent
db0354a6e5
commit
8ee7dbf79e
4 files changed
+238
-2
No files matched your search
+5
-1
@@ -715,7 +715,11 @@ textarea { resize: vertical; min-height: 120px; }
|
||||
} else {
|
||||
setEventStreamStatus('Update failed · showing last activity');
|
||||
}
|
||||
if (snapshot.freshness?.revalidating) {
|
||||
if (snapshot.freshness?.degraded && !snapshot.freshness.revalidating) {
|
||||
const retrySeconds = Number(snapshot.freshness.retry_in_seconds) || 0;
|
||||
setEventStreamStatus('Refresh failed · showing last known data' +
|
||||
(retrySeconds > 0 ? ' · retrying in ' + retrySeconds + 's' : ''));
|
||||
} else if (snapshot.freshness?.revalidating) {
|
||||
setEventStreamStatus('Refreshing · showing recent snapshot');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user