fix
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { resolveChatContentType } from '@/lib/chat-media';
|
||||
|
||||
const DEFAULT_MAX_EDGE = 2560;
|
||||
const DEFAULT_QUALITY = 0.82;
|
||||
|
||||
@@ -107,7 +109,8 @@ export async function readImageDimensions(file: File) {
|
||||
}
|
||||
|
||||
export function createFilePreviewUrl(file: File) {
|
||||
if (file.type.startsWith('image/')) {
|
||||
const contentType = resolveChatContentType(file);
|
||||
if (contentType.startsWith('image/') || contentType.startsWith('video/')) {
|
||||
return URL.createObjectURL(file);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user