fix: handle invalid weather API key gracefully and fix TideDisplay crash
- Fix TideDisplay component crash (use extremes instead of tides) - Handle 401 weather API errors gracefully (return null data with note) - Update weather controller to return 200 with null values instead of 503 - Add helpful message about API key activation time - Fix tide type capitalization (High/Low instead of high/low)
This commit is contained in:
4
src/components/external/TideDisplay.tsx
vendored
4
src/components/external/TideDisplay.tsx
vendored
@@ -84,13 +84,13 @@ export function TideDisplay({ latitude, longitude }: TideDisplayProps) {
|
||||
|
||||
<div className="space-y-2">
|
||||
<div className="text-sm font-medium text-gray-700 mb-2">Today's Tides</div>
|
||||
{tideData.tides.slice(0, 4).map((tide, index) => (
|
||||
{tideData.extremes && tideData.extremes.slice(0, 4).map((tide, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex items-center justify-between py-2 border-b border-gray-100 last:border-0"
|
||||
>
|
||||
<div className="flex items-center space-x-3">
|
||||
<span className="text-lg">{tide.type === 'high' ? '⬆️' : '⬇️'}</span>
|
||||
<span className="text-lg">{tide.type === 'High' ? '⬆️' : '⬇️'}</span>
|
||||
<div>
|
||||
<div className="font-medium capitalize">{tide.type} Tide</div>
|
||||
<div className="text-xs text-gray-500">
|
||||
|
||||
Reference in New Issue
Block a user