We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bc0c35 commit 73a8ca3Copy full SHA for 73a8ca3
src/flows/context/flow.query.tsx
@@ -213,10 +213,14 @@ export const FlowQueryProvider: FC = ({children}) => {
213
}, [flow])
214
215
const generateMap = (): Stage[] => {
216
- if (
217
- !_map.current ||
218
- (!_map.current.length && (flow?.data?.allIDs ?? []).length)
219
- ) {
+ // this is to get around an issue where a panel is added, which triggers the useEffect that updates
+ // _map.current and a rerender that updates the panel view components within the same render cycle
+ // leading to a panel on the list without a corresponding map entry
+ const forceUpdate =
220
+ (flow?.data?.allIDs ?? []).join(' ') !==
221
+ (_map.current ?? []).map(m => m.id).join(' ')
222
+
223
+ if (forceUpdate) {
224
_generateMap()
225
}
226
0 commit comments