fixed image storage local on minio
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useState, useCallback, useEffect, useRef } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import CloseIcon from "./icons/CloseIcon";
|
||||
import { API_URL } from "../config/authConstants";
|
||||
import { getImageUrl } from "../config/authConstants";
|
||||
import { useChats } from "../hooks/useChats";
|
||||
import { useAuthContext } from "../context/AuthContext";
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function ImageViewer({ images, initialIndex = 0, onClose, postDat
|
||||
const { createOrGetChat } = useChats();
|
||||
const { isAuthenticated } = useAuthContext();
|
||||
|
||||
const urls = images.map(u => (u.startsWith("http") ? u : `${API_URL}${u}`));
|
||||
const urls = images.map(u => getImageUrl(u));
|
||||
|
||||
const next = useCallback(() => {
|
||||
setIndex(i => (i + 1) % urls.length);
|
||||
|
||||
Reference in New Issue
Block a user