Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: widget visibility recomputed unnecessarily #454

Open
mman opened this issue Oct 11, 2024 · 0 comments
Open

Bug: widget visibility recomputed unnecessarily #454

mman opened this issue Oct 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mman
Copy link
Collaborator

mman commented Oct 11, 2024

The useVisibilityNotifier custom react hook is invoked repeatedly on every re-render to determine whether the top level box (Energy, Tanks, Batteries, Devices, Environment) should be visible or not.

But the reality is that the box is hidden unless we receive related data from MQTT, and from that moment the box is always visible and never hides because data from MQTT never disappear.

Investigate how to optimise this so that top level components are only made visible once and keep visible without unnecessary re-computations.

export const useVisibilityNotifier = ({ widgetName, visible }: notifyParams) => {

@mman mman added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant