mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 09:15:33 +03:00
Accept any file if supportedMediaTypes is undefined
This commit is contained in:
parent
bf693ab979
commit
35ef1b58cf
1 changed files with 3 additions and 3 deletions
|
@ -222,7 +222,7 @@ function Compose({
|
|||
charactersReservedPerUrl,
|
||||
} = {},
|
||||
mediaAttachments: {
|
||||
supportedMimeTypes = [],
|
||||
supportedMimeTypes,
|
||||
imageSizeLimit,
|
||||
imageMatrixLimit,
|
||||
videoSizeLimit,
|
||||
|
@ -588,7 +588,7 @@ function Compose({
|
|||
alert(`Could not access the given attachment.`);
|
||||
return;
|
||||
}
|
||||
else if (!supportedMimeTypes.includes(file.type)) {
|
||||
else if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) {
|
||||
alert(`Your instance does not allow attachments of type "${file.type}".`);
|
||||
return;
|
||||
}
|
||||
|
@ -1262,7 +1262,7 @@ function Compose({
|
|||
<label class="toolbar-button">
|
||||
<input
|
||||
type="file"
|
||||
accept={supportedMimeTypes.join(',')}
|
||||
accept={supportedMimeTypes?.join(',')}
|
||||
multiple={mediaAttachments.length < maxMediaAttachments - 1}
|
||||
disabled={
|
||||
uiState === 'loading' ||
|
||||
|
|
Loading…
Reference in a new issue