yousefelkilany nsarrazin HF Staff commited on
Commit
7a0286e
·
unverified ·
1 Parent(s): df0f84c

fix: file type matching from clipboard (#1748)

Browse files

fix(chat): update file type matching

fix upload image from clipboard when type is `*`

Co-authored-by: Nathan Sarrazin <[email protected]>

src/lib/components/chat/ChatWindow.svelte CHANGED
@@ -134,7 +134,9 @@
134
  return activeMimeTypes.some((mimeType: string) => {
135
  const [type, subtype] = mimeType.split("/");
136
  const [fileType, fileSubtype] = file.type.split("/");
137
- return type === fileType && (subtype === "*" || fileSubtype === subtype);
 
 
138
  });
139
  });
140
 
 
134
  return activeMimeTypes.some((mimeType: string) => {
135
  const [type, subtype] = mimeType.split("/");
136
  const [fileType, fileSubtype] = file.type.split("/");
137
+ return (
138
+ (type === "*" || fileType === type) && (subtype === "*" || fileSubtype === subtype)
139
+ );
140
  });
141
  });
142