MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / viewportStateForUDID

Function viewportStateForUDID

packages/client/src/app/uiState.ts:225–240  ·  view source on GitHub ↗
(
  state: PersistedUiState,
  udid: string,
  options: { forceFit?: boolean } = {},
)

Source from the content-addressed store, hash-verified

223}
224
225export function viewportStateForUDID(
226 state: PersistedUiState,
227 udid: string,
228 options: { forceFit?: boolean } = {},
229): PersistedViewportState {
230 const viewportState = state.viewportByUDID?.[udid] ?? DEFAULT_VIEWPORT_STATE;
231 if (!options.forceFit) {
232 return viewportState;
233 }
234 return {
235 ...viewportState,
236 pan: DEFAULT_VIEWPORT_STATE.pan,
237 viewMode: "fit",
238 zoom: null,
239 };
240}
241
242export function sanitizePersistedUiState(
243 state: PersistedUiState,

Callers 2

uiState.test.tsFile · 0.90
AppShellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected