Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -22,7 +22,7 @@ const linkStyles = { color: color.Success.Main };
|
||||
* Click handler for external links - uses Tauri shell on desktop/mobile
|
||||
*/
|
||||
const handleExternalLinkClick = (e: MouseEvent<HTMLAnchorElement>) => {
|
||||
const href = e.currentTarget.href;
|
||||
const { href } = e.currentTarget;
|
||||
if (href && (href.startsWith('http://') || href.startsWith('https://'))) {
|
||||
e.preventDefault();
|
||||
openExternalUrl(href);
|
||||
@@ -32,21 +32,21 @@ const handleExternalLinkClick = (e: MouseEvent<HTMLAnchorElement>) => {
|
||||
/**
|
||||
* Preview image component with authentication support
|
||||
*/
|
||||
const AuthenticatedUrlPreviewImg = ({
|
||||
function AuthenticatedUrlPreviewImg({
|
||||
src,
|
||||
useAuthentication,
|
||||
...props
|
||||
}: React.ComponentProps<typeof UrlPreviewImg> & { useAuthentication: boolean }) => {
|
||||
}: React.ComponentProps<typeof UrlPreviewImg> & { useAuthentication: boolean }) {
|
||||
const authenticatedSrc = useAuthenticatedMediaUrl(src, useAuthentication);
|
||||
return <UrlPreviewImg src={authenticatedSrc} {...props} />;
|
||||
};
|
||||
}
|
||||
|
||||
export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
|
||||
({ url, ts, ...props }, ref) => {
|
||||
const mx = useMatrixClient();
|
||||
const useAuthentication = useMediaAuthentication();
|
||||
const [previewStatus, loadPreview] = useAsyncCallback(
|
||||
useCallback(() => mx.getUrlPreview(url, ts), [url, ts, mx])
|
||||
useCallback(() => mx.getUrlPreview(url, ts), [url, ts, mx]),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -74,8 +74,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
|
||||
// SVGs can't be thumbnailed by Matrix servers, load them directly
|
||||
// Also check og:image:type if available
|
||||
const isSvg =
|
||||
ogImage.toLowerCase().endsWith('.svg') ||
|
||||
prev['og:image:type'] === 'image/svg+xml';
|
||||
ogImage.toLowerCase().endsWith('.svg') || prev['og:image:type'] === 'image/svg+xml';
|
||||
const imgUrl = isSvg
|
||||
? mxcUrlToHttp(mx, ogImage, useAuthentication)
|
||||
: mxcUrlToHttp(mx, ogImage, useAuthentication, 256, 256, 'scale', false);
|
||||
@@ -128,7 +127,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number }>(
|
||||
)}
|
||||
</UrlPreview>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export const UrlPreviewHolder = as<'div'>(({ children, ...props }, ref) => {
|
||||
@@ -156,8 +155,8 @@ export const UrlPreviewHolder = as<'div'>(({ children, ...props }, ref) => {
|
||||
root: scrollRef.current,
|
||||
rootMargin: '10px',
|
||||
}),
|
||||
[]
|
||||
)
|
||||
[],
|
||||
),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user