Session Cache Implementation
Nucleic-Session: B2346642-3353-4BD5-9DE2-A8B77BD66C98 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -598,7 +598,18 @@ final class RemoteStore: ObservableObject {
|
|||||||
/// or a representative one. No-op in demo, which seeds the aggregate directly.
|
/// or a representative one. No-op in demo, which seeds the aggregate directly.
|
||||||
private func rebuildAggregate() {
|
private func rebuildAggregate() {
|
||||||
guard !demoMode else { return }
|
guard !demoMode else { return }
|
||||||
sessions = aggregatedSessions()
|
let live = aggregatedSessions()
|
||||||
|
if !live.isEmpty {
|
||||||
|
sessions = live
|
||||||
|
cachedSummaries = live
|
||||||
|
persistSummaries(live)
|
||||||
|
} else if connections.values.contains(where: { $0.connectivity.isLive }) {
|
||||||
|
// Connected, but the host genuinely has no sessions — reflect that honestly.
|
||||||
|
sessions = []
|
||||||
|
} else {
|
||||||
|
// Offline: keep showing the saved history rather than blanking the list.
|
||||||
|
sessions = cachedSummaries
|
||||||
|
}
|
||||||
dashboard = DashboardSnapshot.merged(connections.values.map(\.dashboard))
|
dashboard = DashboardSnapshot.merged(connections.values.map(\.dashboard))
|
||||||
meshPeers = connections.values.flatMap(\.meshPeers)
|
meshPeers = connections.values.flatMap(\.meshPeers)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user