Commit 21df141
committed
fix(fe): get data based on the app type on connect page (#3574)
### TL;DR
Fixed a route path and improved hook usage in the namespace connection flow.
### What changed?
- Fixed the route path in `create-namespace-frame.tsx` by removing the trailing slash from `"/_context/"` to `"/_context"`
- Refactored the `usePublishableToken` function in the namespace connect page to avoid unnecessary hook calls when they're not needed for the current app type
- Added appropriate biome-ignore comments to handle lint warnings for hooks used within conditional blocks
### How to test?
1. Verify that namespace creation works correctly
2. Test the connect page in both cloud and engine contexts to ensure tokens are properly retrieved
3. Confirm that no React hook rules are violated during runtime
### Why make this change?
The trailing slash in the route path could cause routing issues. The hook refactoring improves code efficiency by only calling the relevant data provider hooks based on the current app type, rather than always calling both hooks regardless of which one is needed.1 parent 4766e1d commit 21df141
File tree
2 files changed
+15
-12
lines changed- frontend/src
- app/dialogs
- routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace
2 files changed
+15
-12
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace/connect.tsx
Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments