CONFIG.bypassImgProxyError to load directly from origin

This commit is contained in:
Martti Malmi
2023-11-28 14:20:35 +02:00
parent 07e2c15f54
commit 95aa6f78bb
12 changed files with 93 additions and 88 deletions

View File

@ -5,12 +5,13 @@ import { getUrlHostname } from "@/SnortUtils";
interface ProxyImgProps extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
size?: number;
className?: string;
}
export const ProxyImg = (props: ProxyImgProps) => {
const { proxy } = useImgProxy();
const [loadFailed, setLoadFailed] = useState(false);
const [bypass, setBypass] = useState(false);
const [bypass, setBypass] = useState(CONFIG.bypassImgProxyError);
if (loadFailed) {
if (bypass) {