Skip to content

Commit 41cd2f1

Browse files
committed
fix(map-server): use fixed localStorage key for consistent persistence
Tool ID changes between calls, so use fixed 'map:viewState' key instead.
1 parent a8b2ee3 commit 41cd2f1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

examples/map-server/src/mcp-app.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,11 @@ interface PersistedCameraState {
9393
}
9494

9595
/**
96-
* Get localStorage key for persisting view state
97-
* Uses toolInfo.id (tool invocation ID) if available, otherwise falls back to "default".
98-
* localStorage is scoped per origin, so each tool call can remember its view state.
96+
* Get localStorage key for persisting view state.
97+
* Uses a fixed key so view persists across all tool calls for this server.
9998
*/
10099
function getViewStorageKey(): string {
101-
const context = app.getHostContext();
102-
const toolId = context?.toolInfo?.id ?? "default";
103-
return `map:${toolId}`;
100+
return "map:viewState";
104101
}
105102

106103
/**

0 commit comments

Comments
 (0)