mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
refactor(web): drop duplicate viewport facts spread in webRuntimeFacts (#1928)
`webRuntimeFacts` spread `viewportRuntimeOperationFacts` twice in the same object literal. Both spreads declared the same `setViewport` cell — the first inlined `device.kind === 'device' ? available : openTargetKindUnavailable`, the second passed `browserDevice`, which is defined as exactly that expression — so the second silently won and the first was dead. Keep the `browserDevice` spread, which sits next to the other cells reading the same value. Behavior-neutral: the resulting facts object is unchanged.
This commit is contained in:
committed by
GitHub
parent
6911274952
commit
6604746d49
@@ -254,9 +254,6 @@ function webRuntimeFacts(
|
||||
findText: openTargetKindUnavailable,
|
||||
findSelector: openTargetKindUnavailable,
|
||||
}),
|
||||
...viewportRuntimeOperationFacts({
|
||||
setViewport: device.kind === 'device' ? available : openTargetKindUnavailable,
|
||||
}),
|
||||
...screenshotRuntimeOperationFacts({ capture: browserDevice }),
|
||||
...viewportRuntimeOperationFacts({ setViewport: browserDevice }),
|
||||
// The web backend has no point-addressed read: `get` answers from the captured DOM tree,
|
||||
|
||||
Reference in New Issue
Block a user