fixed image storage local on minio

This commit is contained in:
SlimusMinus
2026-07-10 01:24:58 +03:00
parent 7e9053e498
commit a344540267
9 changed files with 37 additions and 22 deletions

View File

@@ -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);