Commit 4e07a002 authored by Krzysztof Kocot's avatar Krzysztof Kocot Committed by Jakub Lachór
Browse files

Add route guards to prevent unnecessary API calls

Additional fixes for #768:
- Add hive- prefix check for getCommunity, getSubscribers, getAccountNotifications
- Add early return guards in user-profile and post routes to prevent API calls
  when route params don't match expected username format (@/%40 prefix)
- Prevents WaxError exceptions from invalid WASM calls on non-user routes

Files changed:
- community-layout.tsx: Add enabled guard for 3 useQuery hooks
- prefetch-component.tsx: Change condition from if(community) to startsWith check
- post-form.tsx: Add hive- prefix validation to enabled condition
- user-profile/layout.tsx: Add early returns for non-@ params in generateMetadata and Layout
- [p2]/[permlink]/layout.tsx: Add early return for non-@ p2 params
- [p2]/[permlink]/page.tsx: Add notFound() for non-@ p2 params

🤖 Generated with [Claude Code](https://claude.com/claude-code

)

Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
parent 491d5156
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment