Snapshot to root of tree instead of root of subtree

Summary: ^

Reviewed By: LukeDefeo

Differential Revision: D42002750

fbshipit-source-id: 66639d9f55aa850d4be83adee440489cba78d321
This commit is contained in:
Lorenzo Blasa
2022-12-13 13:26:18 -08:00
committed by Facebook GitHub Bot
parent d66b513298
commit dc25a698d5

View File

@@ -130,9 +130,12 @@ export function plugin(client: PluginClient<Events>) {
const seenNodes = new Set<Id>(); const seenNodes = new Set<Id>();
client.onMessage('subtreeUpdate', (event) => { client.onMessage('subtreeUpdate', (event) => {
liveClientData = produce(liveClientData, (draft) => { 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 = { draft.snapshotInfo = {
nodeId: event.rootId, nodeId,
base64Image: event.snapshot, base64Image: event.snapshot,
}; };
} }