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 when clicking 'Re-run' and 'Jump to next error' with a single active error #13

Open
alexjlockwood opened this issue Mar 1, 2020 · 0 comments

Comments

@alexjlockwood
Copy link
Contributor

Here is a video showing how to reproduce: https://youtu.be/WbOxTZhbiRU

  1. Select a layer with a single lint error
  2. Open design lint
  3. Click 'Re-run'
  4. Click 'Jump to next error'
  5. Close the side panel

The expected behavior is that the empty state view should not be shown (the node list should still be shown instead).

I believe the issue is here: https://github.com/destefanis/design-lint/blob/7c4290d8ab7d22d57a1a758a17974c97a2c54e80/src/app/components/App.tsx

This code needs to someething like this:

setActiveNodeIds(activeNodeIds => {
    return activeNodeIds.includes(nodes[0].id)
        ? activeNodeIds
        : [...activeNodeIds, nodes[0].id];
});

Because otherwise the list of active node IDs will contain duplicate IDs (which is what ends up triggering the bug).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant