Repository navigation
Check that the Team page buttons exist before attaching handlers - #187
Closed
bendichter wants to merge 1 commit into
Closed
bendichter wants to merge 1 commit into
bendichter wants to merge 1 commit into
Conversation
main.js attached the "show more" and "show less" handlers without checking that the buttons exist. They are only rendered on the Team page, and only when a group has more than eight members, so the script threw a TypeError on every other page. Most of the diff is re-indentation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for nwborg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
Superseded by #206, which combines this with the related PRs. The commits here are included there unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every page except Team logs
TypeError: Cannot read properties of null (reading 'addEventListener')frommain.js. The script attaches the "show more" and "show less" handlers unconditionally, and those buttons are only rendered on the Team page, and only for a group with more than eight members.This wraps each pair of handlers in a check that the buttons exist. The error was at the end of the handler, so nothing else was being skipped. The diff is four added lines plus re-indentation, so it is easier to read with whitespace hidden.
🤖 Generated with Claude Code