The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/Message/Attachments/hooks/useLoadImage.tsx

8 lines
335 B

import { useCallback, useState } from 'react';
import { useAttachmentAutoLoadEmbedMedia } from '../context/AttachmentContext';
export const useLoadImage = (): [boolean, () => void] => {
const [loadImage, setLoadImage] = useState(useAttachmentAutoLoadEmbedMedia());
return [loadImage, useCallback(() => setLoadImage(true), [])];
};