Commit e8c4576
authored
ENG-790 - Referencing an EVD or RES node on canvas is creating a duplicate node with additional tag (#390)
* Refactor LabelDialogAutocomplete to use async/await for fetching options
- Replaced promise chaining with async/await and try/catch for improved error handling.
- Simplified the fetching logic for main and referenced node options.
- Updated useEffect dependencies for better clarity and performance.
- Changed referencedNode retrieval to use useMemo for optimization.
* Enhance LabelDialogAutocomplete with request ID tracking and cleanup
- Introduced request ID tracking to prevent stale state updates during asynchronous fetching.
- Added cleanup logic in useEffect to manage component lifecycle and avoid memory leaks.
- Improved error handling to ensure console errors are logged only for the latest request.
- Maintained existing async/await structure for fetching options, enhancing clarity and performance.1 parent 6bcad0d commit e8c4576
1 file changed
+59
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
68 | 89 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| |||
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
327 | | - | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
345 | | - | |
346 | | - | |
| 355 | + | |
347 | 356 | | |
348 | 357 | | |
349 | 358 | | |
| |||
0 commit comments