mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
fix: distinguish partial vessel snapshots from stale data
This commit is contained in:
1 parent
531ef52ca4
commit
a25ee64209
13 files changed
+155
-3
No files matched your search
@@ -3,7 +3,7 @@ import { GUIDANCE_STATUSES } from '../loadingFeedback.js';
|
||||
/**
|
||||
* Normalize heterogeneous layer stats into one honest control-chip state.
|
||||
* @param {object|null} stats Layer getStats() result.
|
||||
* @returns {'nominal'|'loading'|'degraded'|'stale'|'fallback'|'unavailable'} Feed state.
|
||||
* @returns {'nominal'|'loading'|'degraded'|'stale'|'partial'|'fallback'|'unavailable'} Feed state.
|
||||
*/
|
||||
export function layerFeedState(stats = {}) {
|
||||
const state = stats || {};
|
||||
@@ -50,5 +50,6 @@ export function layerFeedState(stats = {}) {
|
||||
state.available === false
|
||||
)
|
||||
return 'degraded';
|
||||
if (state.partial === true) return 'partial';
|
||||
return 'nominal';
|
||||
}
|
||||
Reference in new issue
Block a user