Fix WordDetailModal: Complete localhost:3000 hardcoding cleanup
- Fixed API_URL in WordDetailModal.tsx to use explicit undefined check - This completes the Docker deployment fix for all frontend components - Word info modal now works correctly in Docker via nginx proxy - All 4 locations now use consistent environment-aware URL pattern: * api.ts (API client) * videoPlaylist.ts (video URLs) * VideoUpload.tsx (admin video upload) * WordDetailModal.tsx (word info modal) Fixes: Word info click feature in Docker deployment Co-Authored-By: Auggie
This commit is contained in:
@@ -57,7 +57,7 @@ export function WordDetailModal({ term, open, onClose, onAddToSentence }: WordDe
|
||||
const imageMedia = term.media?.find(m => m.kind === 'IMAGE' || m.kind === 'ILLUSTRATION');
|
||||
|
||||
// Construct full video URL
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000';
|
||||
const API_URL = import.meta.env.VITE_API_URL !== undefined ? import.meta.env.VITE_API_URL : 'http://localhost:3000';
|
||||
const videoUrl = videoMedia?.url.startsWith('http')
|
||||
? videoMedia.url
|
||||
: `${API_URL}${videoMedia?.url}`;
|
||||
|
||||
Reference in New Issue
Block a user