Remove coordinate update
Summary: This is no longer needed or sent by the client given our new approach to frames Reviewed By: antonk52 Differential Revision: D44872566 fbshipit-source-id: 9ec340a5cc68605f730cf6677fb89778bf77a3a1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b8feab9a41
commit
1777cbf697
@@ -138,24 +138,6 @@ export function plugin(client: PluginClient<Events>) {
|
|||||||
expandedNodes: createState<Set<Id>>(new Set()),
|
expandedNodes: createState<Set<Id>>(new Set()),
|
||||||
};
|
};
|
||||||
|
|
||||||
client.onMessage('coordinateUpdate', (event) => {
|
|
||||||
liveClientData = produce(liveClientData, (draft) => {
|
|
||||||
const node = draft.nodes.get(event.nodeId);
|
|
||||||
if (!node) {
|
|
||||||
console.warn(`Coordinate update for non existing node `, event);
|
|
||||||
} else {
|
|
||||||
node.bounds.x = event.coordinate.x;
|
|
||||||
node.bounds.y = event.coordinate.y;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (uiState.isPaused.get()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nodes.set(liveClientData.nodes);
|
|
||||||
});
|
|
||||||
|
|
||||||
const setPlayPause = (isPaused: boolean) => {
|
const setPlayPause = (isPaused: boolean) => {
|
||||||
uiState.isPaused.set(isPaused);
|
uiState.isPaused.set(isPaused);
|
||||||
if (!isPaused) {
|
if (!isPaused) {
|
||||||
|
|||||||
@@ -10,18 +10,11 @@
|
|||||||
export type Events = {
|
export type Events = {
|
||||||
init: InitEvent;
|
init: InitEvent;
|
||||||
subtreeUpdate: SubtreeUpdateEvent;
|
subtreeUpdate: SubtreeUpdateEvent;
|
||||||
coordinateUpdate: CoordinateUpdateEvent;
|
|
||||||
perfStats: PerfStatsEvent;
|
perfStats: PerfStatsEvent;
|
||||||
performanceStats: PerformanceStatsEvent;
|
performanceStats: PerformanceStatsEvent;
|
||||||
metadataUpdate: UpdateMetadataEvent;
|
metadataUpdate: UpdateMetadataEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CoordinateUpdateEvent = {
|
|
||||||
observerType: String;
|
|
||||||
nodeId: Id;
|
|
||||||
coordinate: Coordinate;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SubtreeUpdateEvent = {
|
export type SubtreeUpdateEvent = {
|
||||||
txId: number;
|
txId: number;
|
||||||
rootId: Id;
|
rootId: Id;
|
||||||
|
|||||||
Reference in New Issue
Block a user