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 type {
CurrentWeather as CW,
ExtendedForecast as EF,
ExtendedForecast,
Message,
PersonalData,
@@ -41,7 +40,7 @@ export function Homepage() {
const { data: personalData, isFetched: personalIsFetched } = useQueryAPI({
endpoint: 'api/personalData',
});
const { data: messageData, isFetching: isMessagesFetching } = useQueryAPI({
const { data: messageData } = useQueryAPI({
endpoint: 'api/displayedGreeting',
});
const { data: weatherMetadata } = useOSMAPI({
@@ -93,7 +92,14 @@ export function Homepage() {
windDirection: 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: '',
isDaytime: true,
@@ -102,7 +108,7 @@ export function Homepage() {
temperature: 0,
temperatureUnit: 'F',
},
]);
];
const [weatherModalOpened, { open: openWeatherModal, close: closeWeatherModal }] =
useDisclosure(false);
@@ -129,7 +135,7 @@ export function Homepage() {
return message?.message;
});
}
}, [message, personal, isMessagesFetching]);
}, [message, personal]);
useEffect(() => {
if (weather !== undefined && basicWeather !== undefined) {
setCurrent({
@@ -173,16 +179,6 @@ export function Homepage() {
}, [weather, basicWeather]);
useEffect(() => {
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({
office: points?.properties.gridId,
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'}
pos={'relative'}
style={{
zIndex: 1000,
zIndex: searchValue && 1000,
opacity:
searchValue &&
dropdownOpened &&