This commit is contained in:
Sean Edmunds
2026-01-08 13:44:15 -06:00
parent b8239eecbe
commit 27faa69dd5
2 changed files with 12 additions and 16 deletions

View File

@@ -6,7 +6,6 @@ import { useEffect, useState } from 'react';
import { stackClasses } from 'styles'; import { stackClasses } from 'styles';
import type { import type {
CurrentWeather as CW, CurrentWeather as CW,
ExtendedForecast as EF,
ExtendedForecast, ExtendedForecast,
Message, Message,
PersonalData, PersonalData,
@@ -41,7 +40,7 @@ export function Homepage() {
const { data: personalData, isFetched: personalIsFetched } = useQueryAPI({ const { data: personalData, isFetched: personalIsFetched } = useQueryAPI({
endpoint: 'api/personalData', endpoint: 'api/personalData',
}); });
const { data: messageData, isFetching: isMessagesFetching } = useQueryAPI({ const { data: messageData } = useQueryAPI({
endpoint: 'api/displayedGreeting', endpoint: 'api/displayedGreeting',
}); });
const { data: weatherMetadata } = useOSMAPI({ const { data: weatherMetadata } = useOSMAPI({
@@ -93,7 +92,14 @@ export function Homepage() {
windDirection: 0, windDirection: 0,
pressure: 0, pressure: 0,
}); });
const [extendedForecast, setExtendedForecast] = useState<EF[]>([ const extendedForecast = forecast.properties.periods.map((item: ExtendedForecast) => ({
detailedForecast: item.detailedForecast,
isDaytime: item.isDaytime,
name: item.name,
shortForecast: item.shortForecast,
temperature: item.temperature,
temperatureUnit: item.temperatureUnit,
})) || [
{ {
detailedForecast: '', detailedForecast: '',
isDaytime: true, isDaytime: true,
@@ -102,7 +108,7 @@ export function Homepage() {
temperature: 0, temperature: 0,
temperatureUnit: 'F', temperatureUnit: 'F',
}, },
]); ];
const [weatherModalOpened, { open: openWeatherModal, close: closeWeatherModal }] = const [weatherModalOpened, { open: openWeatherModal, close: closeWeatherModal }] =
useDisclosure(false); useDisclosure(false);
@@ -129,7 +135,7 @@ export function Homepage() {
return message?.message; return message?.message;
}); });
} }
}, [message, personal, isMessagesFetching]); }, [message, personal]);
useEffect(() => { useEffect(() => {
if (weather !== undefined && basicWeather !== undefined) { if (weather !== undefined && basicWeather !== undefined) {
setCurrent({ setCurrent({
@@ -173,16 +179,6 @@ export function Homepage() {
}, [weather, basicWeather]); }, [weather, basicWeather]);
useEffect(() => { useEffect(() => {
if (forecast) { if (forecast) {
setExtendedForecast(
forecast.properties.periods.map((item: ExtendedForecast) => ({
detailedForecast: item.detailedForecast,
isDaytime: item.isDaytime,
name: item.name,
shortForecast: item.shortForecast,
temperature: item.temperature,
temperatureUnit: item.temperatureUnit,
})),
);
setCurrentLocation({ setCurrentLocation({
office: points?.properties.gridId, office: points?.properties.gridId,
station: stations?.features[0].properties.stationIdentifier, station: stations?.features[0].properties.stationIdentifier,

View File

@@ -675,7 +675,7 @@ export default function Search({
mt={height > 0 ? `calc(${height}px + 1.5rem)` : '3.75rem'} mt={height > 0 ? `calc(${height}px + 1.5rem)` : '3.75rem'}
pos={'relative'} pos={'relative'}
style={{ style={{
zIndex: 1000, zIndex: searchValue && 1000,
opacity: opacity:
searchValue && searchValue &&
dropdownOpened && dropdownOpened &&