aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/endpoints.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-14 19:26:55 +0300
committerGitHub <noreply@github.com>2026-09-14 19:26:55 +0300
commitb5154541cc75f9f12b7c14964d4d277d505a5f45 (patch)
tree1a45e3eb71730ab97983d8c92edcb72a7d963ab9 /src/client/shell/endpoints.rs
parent03749ae3970a74e077fc16b9327bddfc957771c9 (diff)
fix: restore saved machine screens after reconnect (#4126)
refs #3842
Diffstat (limited to 'src/client/shell/endpoints.rs')
-rw-r--r--src/client/shell/endpoints.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client/shell/endpoints.rs b/src/client/shell/endpoints.rs
index d3823d54..c27358e5 100644
--- a/src/client/shell/endpoints.rs
+++ b/src/client/shell/endpoints.rs
@@ -208,6 +208,7 @@ impl ClientShellState {
let Some(snapshot) = endpoint.snapshot.clone() else {
return false;
};
+ let generation = endpoint.snapshot_generation;
let switching_endpoint = endpoint_id != &self.active_endpoint_id;
let agent_scroll = self.agent_scroll;
if switching_endpoint {
@@ -215,7 +216,7 @@ impl ClientShellState {
self.pane_surface = None;
self.pending_pane_surface = None;
}
- self.apply_active_snapshot(snapshot);
+ self.apply_active_snapshot(snapshot, generation);
if switching_endpoint {
// The aggregate agent list belongs to the client, not one endpoint.
self.agent_scroll = agent_scroll;
@@ -653,16 +654,21 @@ impl ClientShellState {
}
fn apply_cached_endpoint_snapshot(&mut self, endpoint_id: &ClientEndpointId) {
- let Some(snapshot) = self
+ let Some((snapshot, generation)) = self
.endpoints
.iter()
.find(|endpoint| &endpoint.endpoint_id == endpoint_id)
- .and_then(|endpoint| endpoint.snapshot.clone())
+ .and_then(|endpoint| {
+ endpoint
+ .snapshot
+ .clone()
+ .map(|snapshot| (snapshot, endpoint.snapshot_generation))
+ })
else {
return;
};
if endpoint_id == &self.active_endpoint_id {
- self.apply_active_snapshot(snapshot);
+ self.apply_active_snapshot(snapshot, generation);
}
}
}