fix: gate Velt UI components on useVeltInitState to prevent permissio… #38
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.
…n_denied on first load
Previously, VeltComments, VeltCommentsSidebar, and VeltCursor mounted immediately when VeltCollaboration rendered, before auth and document setup completed. This caused Firebase permission_denied errors in iframe contexts where sessionStorage is used (fresh auth each load).
This fix wraps these components in a conditional that checks useVeltInitState(), which returns true only when both user authentication AND document setup are complete. This mirrors the pattern already used in ReactFlowComponent.
Changes:
🤖 Generated with Claude Code
Pull Request
Description
Type of Change
Monorepo Structure Checklist
If adding a new demo, ensure you've followed the 5-level structure:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/package.jsonwith scoped name:@apps/<framework>-<document>-<library-or-solution>-<demo>pnpm --filter <package-name> buildpnpm --filter <package-name> devDeployment Checklist
If this demo should be deployed:
Testing
pnpm -w install && pnpm -w buildDocumentation
master-sample-app(if applicable)Related Issues
Screenshots/Videos
Additional Context
For Reviewers
Demo Location
Path:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/Package name:
@apps/<...>How to Test
Structure Verification
The demo follows the 5-level hierarchy:
Documentation: See README_MONOREPO.md and docs/structure.md for more details on the monorepo structure.
Note
Ensures Velt UI mounts only after auth and document setup to prevent first-load
permission_deniederrors (notably in iframe/sessionStorage contexts).useVeltInitStatein allVeltCollaboration.tsxdemo files (dashboards, tables, text editors, CRDT)VeltComments,VeltCommentsSidebar, andVeltCursorwithveltInitialized && (...)VeltInitializeDocumentandVeltCustomizationoutside the conditionalWritten by Cursor Bugbot for commit 791873b. This will update automatically on new commits. Configure here.