From dc25a698d523a996040c5d40023444455c95b14b Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Tue, 13 Dec 2022 13:26:18 -0800 Subject: [PATCH] Snapshot to root of tree instead of root of subtree Summary: ^ Reviewed By: LukeDefeo Differential Revision: D42002750 fbshipit-source-id: 66639d9f55aa850d4be83adee440489cba78d321 --- desktop/plugins/public/ui-debugger/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/plugins/public/ui-debugger/index.tsx b/desktop/plugins/public/ui-debugger/index.tsx index 3598d1e08..a418dd2c2 100644 --- a/desktop/plugins/public/ui-debugger/index.tsx +++ b/desktop/plugins/public/ui-debugger/index.tsx @@ -130,9 +130,12 @@ export function plugin(client: PluginClient) { const seenNodes = new Set(); client.onMessage('subtreeUpdate', (event) => { liveClientData = produce(liveClientData, (draft) => { - if (event.snapshot) { + // FIXME: remove node id from snapshot as is always + // for the entire screen. + const nodeId = rootId.get(); + if (event.snapshot && nodeId) { draft.snapshotInfo = { - nodeId: event.rootId, + nodeId, base64Image: event.snapshot, }; }