Skip to content

Commit 8aa5293

Browse files
committed
widgetOperation: add a FIXME on unclear code block
issue #1130 seems unrelated to the commit that fixed it, but what caused the error is the mentioned code block mis-behaving in a specific case. This should either be better documented or investigated.
1 parent 17765e6 commit 8aa5293

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/evolution-frontend/src/actions/utils/WidgetOperation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,17 @@ const prepareSimpleWidget = (
179179
pointLastAction === 'mapClicked' ||
180180
pointLastAction === 'geocoding' ||
181181
pointLastAction === 'findPlace';
182-
// set to undefined if it was invisible before, and becomes visible:
182+
// set to undefined if it was invisible before, and becomes visible
183+
//
184+
// FIXME This `if` includes a lot more cases than the line above explains.
185+
// Why? What is the purpose of this exactly? This caused a weird bug where
186+
// the `isResponded` was reset to false in a case where the value (null) was
187+
// not the same as the default (undefined) even though the
188+
// affectedPath['all'] was true and the widget happened to be displayed as
189+
// valid, even if it was invalid... See
190+
// https://github.com/chairemobilite/evolution/issues/1130 and the weird
191+
// commit which solved this single bug, but there's something fishy in this
192+
// code block
183193
if (
184194
isVisible &&
185195
((previousStatus && previousStatus.isVisible === false) ||

0 commit comments

Comments
 (0)