Set use-credentials on commercial deployment if authToken is set on canvas image calls, comment out the UpdateImageUrls on connect listener

This commit is contained in:
Brandon Rising 2023-06-28 14:32:20 -04:00 committed by psychedelicious
parent 8a90e51408
commit 8f6b3660c5
2 changed files with 6 additions and 2 deletions

View File

@ -198,7 +198,7 @@ addControlNetImageProcessedListener();
addControlNetAutoProcessListener(); addControlNetAutoProcessListener();
// Update image URLs on connect // Update image URLs on connect
addUpdateImageUrlsOnConnectListener(); // addUpdateImageUrlsOnConnectListener();
// Boards // Boards
addImageAddedToBoardFulfilledListener(); addImageAddedToBoardFulfilledListener();

View File

@ -3,6 +3,7 @@ import { Image, Rect } from 'react-konva';
import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { useGetImageDTOQuery } from 'services/api/endpoints/images';
import useImage from 'use-image'; import useImage from 'use-image';
import { CanvasImage } from '../store/canvasTypes'; import { CanvasImage } from '../store/canvasTypes';
import { $authToken } from 'services/api/client';
type IAICanvasImageProps = { type IAICanvasImageProps = {
canvasImage: CanvasImage; canvasImage: CanvasImage;
@ -12,7 +13,10 @@ const IAICanvasImage = (props: IAICanvasImageProps) => {
const { currentData: imageDTO, isError } = useGetImageDTOQuery( const { currentData: imageDTO, isError } = useGetImageDTOQuery(
imageName ?? skipToken imageName ?? skipToken
); );
const [image] = useImage(imageDTO?.image_url ?? '', 'anonymous'); const [image] = useImage(
imageDTO?.image_url ?? '',
$authToken.get() ? 'use-credentials' : 'anonymous'
);
if (isError) { if (isError) {
return <Rect x={x} y={y} width={width} height={height} fill="red" />; return <Rect x={x} y={y} width={width} height={height} fill="red" />;