bito-code-review[bot] commented on code in PR #38958:
URL: https://github.com/apache/superset/pull/38958#discussion_r3021412954
##########
superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/useDeckLayerMetadata.ts:
##########
@@ -35,7 +35,7 @@ export const useDeckLayerMetadata = (
error: string | null;
} => {
const [layers, setLayers] = useState<LayerInfo[]>([]);
- const [isLoading, setIsLoading] = useState(false);
+ const [isLoading, setIsLoading] = useState(sliceIds.length > 0);
Review Comment:
<!-- Bito Reply -->
The applied change in useDeckLayerMetadata.ts adds `setIsLoading(false);` to
the early return block when `sliceIds` is empty or null. This ensures the
loading state is reset, preventing the UI from showing a loading indicator
unnecessarily when no layers are being fetched.
**superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/useDeckLayerMetadata.ts**
```
if (!sliceIds || sliceIds.length === 0) {
setLayers([]);
setIsLoading(false);
return;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]