zdjęcia pobierają się na głównej stronie + naprawiono kilka innych bugów.
takich jak wyświetlanie "Moich ogłoszeń nie dla poprawnego id etc."
This commit is contained in:
@@ -34,7 +34,7 @@ export function NoticeCard({ notice }) {
|
||||
const fetchImage = async () => {
|
||||
if (!noticeId) {
|
||||
if (isMounted) {
|
||||
setImage("https://http.cat/404.jpg");
|
||||
setImage({uri: "https://http.cat/404.jpg"});
|
||||
setIsLoading(false);
|
||||
}
|
||||
return;
|
||||
@@ -45,13 +45,13 @@ export function NoticeCard({ notice }) {
|
||||
const images = await getAllImagesByNoticeId(noticeId);
|
||||
if (isMounted) {
|
||||
setImage(
|
||||
images && images.length > 0 ? images[0] : "https://http.cat/404.jpg"
|
||||
images && images.length > 0 ? images[0] : {uri: "https://http.cat/404.jpg"}
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error while loading image: ${error}`);
|
||||
if (isMounted) {
|
||||
setImage("https://http.cat/404.jpg");
|
||||
setImage({uri: "https://http.cat/404.jpg"});
|
||||
}
|
||||
} finally {
|
||||
if (isMounted) {
|
||||
@@ -81,9 +81,7 @@ export function NoticeCard({ notice }) {
|
||||
</Box>
|
||||
) : (
|
||||
<Image
|
||||
source={{
|
||||
uri: image,
|
||||
}}
|
||||
source={image}
|
||||
className="h-auto w-full rounded-md aspect-[1/1]"
|
||||
alt="image"
|
||||
resizeMode="cover"
|
||||
|
||||
Reference in New Issue
Block a user