dev #21

Merged
Seazn merged 35 commits from dev into main 2026-05-21 17:34:44 +00:00
Showing only changes of commit 6441a39e71 - Show all commits

View File

@ -40,7 +40,6 @@ export function useCoffeePictures(coffeeId?: string) {
useEffect(() => { useEffect(() => {
if (!coffeeId) { if (!coffeeId) {
setPictureUrls([]);
return; return;
} }
@ -51,9 +50,10 @@ export function useCoffeePictures(coffeeId?: string) {
]; ];
let isCancelled = false; let isCancelled = false;
setLoading(true);
const loadPictures = async () => { const loadPictures = async () => {
if (!isCancelled) setLoading(true);
for (const url of candidateUrls) { for (const url of candidateUrls) {
try { try {
const response = await authFetch(url, { const response = await authFetch(url, {
@ -105,5 +105,8 @@ export function useCoffeePictures(coffeeId?: string) {
}; };
}, [coffeeId]); }, [coffeeId]);
return { pictureUrls, loading }; return {
pictureUrls: coffeeId ? pictureUrls : [],
loading: coffeeId ? loading : false,
};
} }