Skip to content

Commit a0868b2

Browse files
authored
Merge pull request #172 from boostcampwm-2024/bug-fe-#171
첫 렌더링 시 pages 쿼리 중복 요청 수정
2 parents 2163953 + 67291a5 commit a0868b2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/src/components/canvas/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ function Flow({ className }: CanvasProps) {
7474
const initialNodes = Array.from(nodesMap.values()) as Node[];
7575
setNodes(initialNodes);
7676

77+
let isInitialSync = true;
78+
7779
nodesMap.observe((event) => {
80+
if (isInitialSync) {
81+
isInitialSync = false;
82+
return;
83+
}
84+
7885
event.changes.keys.forEach((change, key) => {
7986
const nodeId = key;
8087
if (change.action === "add" || change.action === "update") {

0 commit comments

Comments
 (0)